Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Community,
i want to make the left side of the set modifier inside a set analysis variable.
For that i use a simple List of possible dimensions names & and a variable that catches the current field selection.
I want to use the list as follows:
SUM({1<$(LIST)=P()>} KPI)
So inside the dimension list if i select DIM_A
the set analysis should use SUM({1<DIM_A=P()>} KPI)
This is not working
What do i wrong?
Check out the sample
Although the expression editor is showing red error lines, but the expression should still give you the output you are expecting to see
May be use like this:
Sum({1<$(=LIST) = P()>} KPI)
And it seems to be working!!
Did you just try and got it, or you knew this? Because I never tried this way knowing this as known fact!! So I knew not right.
Check out the sample
Although the expression editor is showing red error lines, but the expression should still give you the output you are expecting to see
I have seen this done before. I just added a sample below as well. I think this is not a variable, but a dollar sign expansion which is returning a dimension. So, as long as a single dimension is returned, the expression will show the expected results
This works even with variable expansion I tested.
As long as it end up giving a field name, the expression should be good to go.
Works also with variables, but you'll need a transfer from field to variable somewhere along the road. Most often this is done by giving this variable the same value as the one Sunny put between parentheses (e.g. =List)
Note that $-sign substitution works almost everywhere and is done before everything else. Pretty powerful stuff...
Make sure the variable expands to a single field name, and enclose the expansion in [/] to correctly handle more complex field names:
=Sum({1<[$(=LIST)] = P()>} KPI)
^ ^
That's true, or even this:
=Sum({1<$(='[' & LIST & ']') = P()>} KPI)