IIF statement in MDX
Posted: Thu Feb 11, 2021 11:20 am
Hello Everyone,
I am trying to create an MDX statement using IIF Condition but my solution seem not working in Expression MDX tester in TM1. I would love some help on this.
Basicly, I am testing :
If ( type = A , show elemnts of type A , If ( Type=B , show elemnt of Type B , else show C )
I have hierarchy like this :
A-> B -> C or B->C or just B
This is the logic behind my MDX. So I created Like this :
When I try this it throws me this error :
https://ibb.co/grHCz3p
What I want to do is show up elements of Type A if they existenet f they dont show up elemnt of type B if they exist else show up C.
I tried using this MDX:
But it ended up showing me elemnt A and all its children and non children , I want if I have :
A1 -> B1 -> C1 and B2->C2 and C3 ==> I want to show up A1 , B2 , C3 .
Hope it make sense. And I would love to help me understand what I messed up in my MDX.
Thank you in adavance
I am trying to create an MDX statement using IIF Condition but my solution seem not working in Expression MDX tester in TM1. I would love some help on this.
Basicly, I am testing :
If ( type = A , show elemnts of type A , If ( Type=B , show elemnt of Type B , else show C )
I have hierarchy like this :
A-> B -> C or B->C or just B
This is the logic behind my MDX. So I created Like this :
Code: Select all
IIF( [z_test].[Type]="A", {FILTER(DESCENDANTS([z_test].[Total]),[z_test].[Type] = "A")} ,
IIF( [z_test].[Type]="B", {FILTER(DESCENDANTS([z_test].[Total]),[z_test].[Type] = "B")},
{FILTER(DESCENDANTS([z_test].[Total]),[z_test].[Type] = "C")}
)
)
https://ibb.co/grHCz3p
What I want to do is show up elements of Type A if they existenet f they dont show up elemnt of type B if they exist else show up C.
I tried using this MDX:
Code: Select all
{FILTER(DESCENDANTS([z_test].[Total]),[z_test].[Type] = "A" or [z_test].[Type] = "B" [z_test].[Type] = "C" )}
A1 -> B1 -> C1 and B2->C2 and C3 ==> I want to show up A1 , B2 , C3 .
Hope it make sense. And I would love to help me understand what I messed up in my MDX.
Thank you in adavance