MDX Filter by string cell value (Updated)
Posted: Wed Jul 20, 2016 12:03 pm
UPDATED
Hi,
I have the following MDX subset that I use as a picklist. The plan is to have it change depending on a selection in another picklist.
{FILTER(
TM1SUBSETALL( [SubAccount] ),
[SubAccount].[MainAccount] = [Cube].([Measure].[MainAccountPicklist])
)}
The Im fairly sure problem is that the statement [Cube].([Measure].[MainAccountPicklist]) isnt recognized as a string. If I just write the account as "1910" everything works great.
How do I write [Cube].([Measure].[MainAccountPicklist]) for it to be acceptet by MDX as a string? I tried enclosing it in ' and " which of course makes the statement a string. I tried also tried enclosing a " with ' and adding the statement with +. But I couldn't get it to work.
Im sure someone here knows this by heart. I looked in the MDX Primer but it only states that this should work, and that strings need to be enclosed in " ", not how to used string cells.
Update:
It seems the problem is not the filter not understanding that the cell value is a string. The problem is that the picklist doesnt know which row it is on, and always
The MDX statement doesnt know which member on the row dimension it is at, and therefore dynamically updates according to the first element on the rows string value.
Rewritten MDX looks like this:
{FILTER(
TM1SUBSETALL( [SubAccount] ),
[SubAccount].[MainAccount] = [Cube].([Row].CurrentMember, [ColumnMeasure].[MainAccountPicklist])
)}
How would I get the MDX to understand on what row it is? The above statement does not work.
Hi,
I have the following MDX subset that I use as a picklist. The plan is to have it change depending on a selection in another picklist.
{FILTER(
TM1SUBSETALL( [SubAccount] ),
[SubAccount].[MainAccount] = [Cube].([Measure].[MainAccountPicklist])
)}
The Im fairly sure problem is that the statement [Cube].([Measure].[MainAccountPicklist]) isnt recognized as a string. If I just write the account as "1910" everything works great.
How do I write [Cube].([Measure].[MainAccountPicklist]) for it to be acceptet by MDX as a string? I tried enclosing it in ' and " which of course makes the statement a string. I tried also tried enclosing a " with ' and adding the statement with +. But I couldn't get it to work.
Im sure someone here knows this by heart. I looked in the MDX Primer but it only states that this should work, and that strings need to be enclosed in " ", not how to used string cells.
Update:
It seems the problem is not the filter not understanding that the cell value is a string. The problem is that the picklist doesnt know which row it is on, and always
The MDX statement doesnt know which member on the row dimension it is at, and therefore dynamically updates according to the first element on the rows string value.
Rewritten MDX looks like this:
{FILTER(
TM1SUBSETALL( [SubAccount] ),
[SubAccount].[MainAccount] = [Cube].([Row].CurrentMember, [ColumnMeasure].[MainAccountPicklist])
)}
How would I get the MDX to understand on what row it is? The above statement does not work.