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

Set analysis ignores my sub-selection when defined a range of values

Hi,

I defined in the expression to only view a specfic set of data, but I might want to view only a sub-part of the presentation by selecting one (or more) of the possible values. Unfortunately, I don't know how to do this... It always sticks to the selections made in the set analysis expression. Since 'C' is a value of the array 'A,B,C,D,E' I would think this should work?

1.png

Script:

Test:

load * inline [

Name, Salary

A,10

B,20

C,30

D,40

E,50];

Set analysis expression: sum({<[Name]={'A','B','C','E'}>} Salary)

Tags (1)
1 Solution

Accepted Solutions

Re: Set analysis ignores my sub-selection when defined a range of values

In Set Analysis, when you add a filter Name={something}, the equals sign "=" means "replace user selections with this". So obviously any of your selections in the same field will get ignored, or more accurately, replaced with the filter values.

In order to allow both selections, you need to add one of the Boolean operators before the + sign. For example, this should do what you are looking for:

sum({<[Name]*={'A','B','C','E'}>} Salary)

*= means the intersection of user selections with the list of values. So, when nothing is selected, you will get A, B, C, E. If you select one of the four values, you will get just what you've selected.

cheers,

Oleg Troyansky

Upgrade your Qlik skills at the Masters Summit for Qlik - coming soon to Milan, Italy and Austin, TX!

6 Replies

Re: Set analysis ignores my sub-selection when defined a range of values

Try this:

Sum({<[Name] *= {'A','B','C','E'}>} Salary)

MVP
MVP

Re: Set analysis ignores my sub-selection when defined a range of values

I believe you want to use the intersection operator * here:

sum({<[Name] *= {'A','B','C','E'}>} Salary)

Re: Set analysis ignores my sub-selection when defined a range of values

In Set Analysis, when you add a filter Name={something}, the equals sign "=" means "replace user selections with this". So obviously any of your selections in the same field will get ignored, or more accurately, replaced with the filter values.

In order to allow both selections, you need to add one of the Boolean operators before the + sign. For example, this should do what you are looking for:

sum({<[Name]*={'A','B','C','E'}>} Salary)

*= means the intersection of user selections with the list of values. So, when nothing is selected, you will get A, B, C, E. If you select one of the four values, you will get just what you've selected.

cheers,

Oleg Troyansky

Upgrade your Qlik skills at the Masters Summit for Qlik - coming soon to Milan, Italy and Austin, TX!

Re: Set analysis ignores my sub-selection when defined a range of values

with Sunny and Stefan here, why even bother? :-)

Re: Set analysis ignores my sub-selection when defined a range of values

One of Henric's hic‌ recent blogs gave an overview of Set operators

Implicit Set Operators

Not applicable

Re: Set analysis ignores my sub-selection when defined a range of values

Wow, what a team!!

Thanks a lot for all the replies! Needless to say, they were all correct!

Unfortunately I can only select one as 'THE' correct answer... but kudos for all of you .

Love this forum and it's members.

Community Browser