12 Replies Latest reply: Sep 13, 2016 7:57 AM by Paul Steinborn

# 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?

• ###### Re: Variable left side of Set Modifier in Set Analysis

May be use like this:

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

• ###### Re: Variable left side of Set Modifier in Set Analysis

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.

• ###### Re: Variable left side of Set Modifier in Set Analysis

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

• ###### Re: Variable left side of Set Modifier in Set Analysis

This works even with variable expansion I tested.

• ###### Re: Variable left side of Set Modifier in Set Analysis

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

• ###### Re: Variable left side of Set Modifier in Set Analysis

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...

• ###### Re: Variable left side of Set Modifier in Set Analysis

Thanks for the massive participation in this case!

Using it directly from the field : Sum({1<\$(=LIST) = P()>} KPI)

OR

Using it with an variable : Sum({1<\$(vListVal) = P()>} KPI)

both work great in QlikView BUT when trying this solutions in QlikSense it seems not to work

• ###### Re: Variable left side of Set Modifier in Set Analysis

Seems to be working here

• ###### Re: Variable left side of Set Modifier in Set Analysis

Yes you are right, i had a problem with my QlikSense APP.

Thanks!

• ###### Re: Variable left side of Set Modifier in Set Analysis

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

• ###### Re: Variable left side of Set Modifier in Set Analysis

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)

^             ^

• ###### Re: Variable left side of Set Modifier in Set Analysis

That's true, or even this:

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