Except MDX Function
Posted: Thu Oct 17, 2024 10:53 am
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
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