MDX - FilterByPattern on Attributes
Posted: Thu Jul 26, 2018 1:00 pm
Someone asked me today how to pull a wildcard search against an attribute in MDX. I must be getting rusty (I blame Tableau and PowerBI) as this turned out to be a bit more long winded than I thought and I ended up sticking at the following rather obtuse statement - in this case returning Employees which have *PR* in their Cost Centre attribute.
{ FILTER(
{ TM1FILTERBYLEVEL(
{ TM1SUBSETALL( [Employee] ) }, 0) }
, INSTR([Employee].[Cost Centre], "PR") >0
)}
Seems messier than it should be - any tidy up suggestions welcome!
KR
{ FILTER(
{ TM1FILTERBYLEVEL(
{ TM1SUBSETALL( [Employee] ) }, 0) }
, INSTR([Employee].[Cost Centre], "PR") >0
)}
Seems messier than it should be - any tidy up suggestions welcome!
KR