Page 1 of 1

PAW MDX Query

Posted: Fri Jan 05, 2024 4:47 pm
by RSK
Hi,

I have two dims in my model where one is a deeper hierarchy than the other, but the first 3 levels from the top are the same in both.

I have a cube which allows a user to select a member from the smaller dim and then tries to pass the selection in the larger dim via MDX to a subset. I then want that to expand fully out from the member it has selected.

If I remove the TM1DRILLDOWNMEMBER statement surrounding the selection then the member selection works, I just can't get it to expand fully out form that point.

TM1DRILLDOWNMEMBER(

{STRTOMEMBER("[Clients].[" + [User Selection].(STRTOMEMBER("[}Clients].[" + USERNAME + "]"),[String Value].[Value],[Selection Measures].[Agency]) + "]")}

, RECURSIVE)

The error I get is the following

Validation failed.
MDX has invalid expression. Syntax error at or near: ' RECURSIVE) } ON 1 FROM [Client Revenue ... ', character position 233


Any assistance welcome

Re: PAW MDX Query

Posted: Fri Jan 05, 2024 5:03 pm
by MarenC
Hi,

Don't you need an ALL before the recursive, so:

, ALL, RECURSIVE)

Maren

Re: PAW MDX Query

Posted: Fri Jan 05, 2024 5:12 pm
by RSK
Perfect, all sorted.

Thanks!

Re: PAW MDX Query

Posted: Fri Jan 05, 2024 8:04 pm
by Wim Gielis
Or, use the Descendants function with an easier syntax.