I'm a BI starter with SSAS and SSRS and I have a very basic question of MDX.
It is very easy to get all values that match a condition in a calculated member. For example
WITH MEMBER [MEASURES].TOTAL_DOT_TEST
AS
(
[Dim Transportation Incident Dot Classification].[Dim Transportation Incident Dot Classification].&[3],
[Measures].[Fact Transportation Incident Count]
)
will get the number of transportation incidents that have a classification value of 3.
However, using this example, how do I get the number of transportation incidents that does not have an ID of 3?
Something like select * from table where classification <> 3
Thanks
You can use Aggregate() and Except() as following :
WITH MEMBER [MEASURES].TOTAL_DOT_TEST
AS Aggregate (
Except(
[Dim Transportation Incident Dot Classification].[Dim Transportation Incident Dot Classification].members ,
{ [Dim Transportation Incident Dot Classification].[Dim Transportation Incident Dot Classification].&[3] }
),
[Measures].[Fact Transportation Incident Count]
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With