Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Variable left side of Set Modifier in Set Analysis

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?


1 Solution

Accepted Solutions
sunny_talwar

Check out the sample

Capture.PNG

Although the expression editor is showing red error lines, but the expression should still give you the output you are expecting to see

View solution in original post

12 Replies
sunny_talwar

May be use like this:


Sum({1<$(=LIST) = P()>} KPI)

tresesco
MVP
MVP

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.

sunny_talwar

Check out the sample

Capture.PNG

Although the expression editor is showing red error lines, but the expression should still give you the output you are expecting to see

sunny_talwar

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

tresesco
MVP
MVP

This works even with variable expansion I tested.

sunny_talwar

As long as it end up giving a field name, the expression should be good to go.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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)

Variable Left Side of Set Modifier in Set Analysis thread232280.jpg

Note that $-sign substitution works almost everywhere and is done before everything else. Pretty powerful stuff...

jonathandienst
Partner - Champion III
Partner - Champion III

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)

              ^             ^

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sunny_talwar

That's true, or even this:

=Sum({1<$(='[' & LIST & ']') = P()>} KPI)