Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
biob_stein
Contributor

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

Re: Variable left side of Set Modifier in Set Analysis

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

12 Replies

Re: Variable left side of Set Modifier in Set Analysis

May be use like this:


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

MVP
MVP

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

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

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

MVP
MVP

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)

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

MVP
MVP

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)

              ^             ^

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

Re: Variable left side of Set Modifier in Set Analysis

That's true, or even this:

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

Community Browser