Page 1 of 1

Except MDX Function

Posted: Thu Oct 17, 2024 10:53 am
by lm756
Hi all,

Having a bit of sticky one with getting a bit of MDX to work. The premise is that I want to return in my dynamic report all subprojects under the based on the selected Cost Centre while excluding those that begin with "G".

The code I have constructed is as follow

For reference Cell E13 = FAC01
and Cell E14 = G

=("EXCEPT({GENERATE(TM1FILTERBYLEVEL(DESCENDANTS([Subproject].[Cost Centre].["&$E$13&"]) , 0) , {STRTOMEMBER("&""""&"[Subproject].["&""""&" + [Subproject].[Cost Centre].CURRENTMEMBER.NAME + "&""""&"]"&""""&")}), {TM1FilterByPattern({TM1FilterByLevel({TM1SubsetAll([Subproject])},0)},"""&$E$14)&"*"")}")

Both sets work fine on their own but when combined with the EXCEPT at the beginning it doesn't work. Anyone got any ideas, I'm a bit stumped?

Thanks
Louis

Re: Except MDX Function

Posted: Thu Oct 17, 2024 11:43 am
by Elessar
Just copy the MDX to MDX editor in PAW (or any other editor) and check for parentheses consistency.

One thing I've noticed right away: MDX is starting with "EXCEPT(", therefore it should end with ")"

Re: Except MDX Function

Posted: Thu Oct 17, 2024 12:54 pm
by lm756
Thanks Elessar,

I've checked the parentheses and have got it to work.

Thanks for the tip re MDX editor in PAW :)