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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
siri_v
Contributor II
Contributor II

Set analysis help

Hello all, I need help with this Set analysis calc. 

I need to default the table/dashboard always with the below calculation where Year is max and Product should be defaulted to "All". This is working as expected.

But when I change the product filter to a different option, it still shows the results of Product"All" category. 

I am not able to get dynamic update for Product field. Can you help with syntax for the same. 

  (Sum({$<Year={$(=Max(Year(Saledate)))},Product={"All"}>}Sales)

Labels (1)
1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

If you specify a field and value in set analysis, it will override any selections made in the field in a filter.

Not sure of the exact behavior you are looking for, but to default to 'All', but switch to products selected in filter if a filter is applied, you could use something like:

sum({$<Year={$(=Max(Year(Saledate)))},Product={$(=if(GetSelectedCount(Product)=0,'All',GetFieldSelections(Product)))}>}Sales)

 

 

View solution in original post

2 Replies
GaryGiles
Specialist
Specialist

If you specify a field and value in set analysis, it will override any selections made in the field in a filter.

Not sure of the exact behavior you are looking for, but to default to 'All', but switch to products selected in filter if a filter is applied, you could use something like:

sum({$<Year={$(=Max(Year(Saledate)))},Product={$(=if(GetSelectedCount(Product)=0,'All',GetFieldSelections(Product)))}>}Sales)

 

 

siri_v
Contributor II
Contributor II
Author

Excellent @GaryGiles ! This is exactly what I need.. Worked like a charm! Thanks a ton!