Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sifatnabil
Specialist
Specialist

Baffling issue with simple set analysis

Hi all,

I have a chart with time on dimension and this simple set expression:

sum({<Product={'Product A','Product B','Product X','Product D'}>}Revenue)

For some reason, the chart doesn't change when I select a single product like Product A. Expected behaviour should be that the chart changes to show only Product A revenues. Any idea how this could happen? It doesn't seem to reflect any selection made on the Product listbox.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Use

sum({<Product *= {'Product A','Product B','Product X','Product D'}>}Revenue)

View solution in original post

7 Replies
MK_QSL
MVP
MVP

Use

sum({<Product *= {'Product A','Product B','Product X','Product D'}>}Revenue)

sifatnabil
Specialist
Specialist
Author

Thanks Manish - this works but why? Haven't seen this before.

swuehl
MVP
MVP

That's because you override user selection in Product with a fixed list of porducts.

You need to use the set intersection operator * as Manish Kachhia suggested to keep your current user selections in the game.

simenkg
Specialist
Specialist

Because the set analysis you wrote overwrites any selection in the field.

the *= modifier says to chose the Product that is both in the current selection and the specified list.

sifatnabil
Specialist
Specialist
Author

But I applied the same set analysis on another chart in the same sheet, with the same products, except it was

count({<Product = {'Product A','Product B','Product X','Product D'}>}orders) instead of sum. Why does it work here but not in the other chart?

swuehl
MVP
MVP

Well, it shouldn't change, if this is the only aggregation in your chart.

Can you upload a small sample QVW?

SreeniJD
Specialist
Specialist

I guess, Count and Sum works differently in the backend. Count just a need a pointer reference to count the record but Sum need to fetch the data so, it might not work

Sreeni