Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

Set Analysis initial value reacts to user selection

Hi Community, 

I'm a bit confused because of the following, really simple looking example: The goal is to show total of current year value. User should be able to change value by selecting last year. 

Sales:
load * inline [
Year, Sales
2020,100
2019,99
2018,98
];

WasisThis.PNG

Why do I still see 100? I've expected 99.

 

Labels (3)
1 Solution

Accepted Solutions
Highlighted
Partner
Partner

 HI

it seems you are confusing 

set analysis from regular selections , 

set analysis is like making a selection on the field and it's disregarding other selection in the field 

in your case it doesn't matter what you'll choose in the year field it will always return 100 , because it's going to disregard the selection . 

in your case if you want the regular  behavior then you just use sum(Sales) , that way if you select a year you'll get this year result and if you don't select any year you'll get the total of all years , 

if you look for a solution to always display the max year from available years  you can use 

sum({<Year = {"$(=max(Year))"}>}Sales)

View solution in original post

1 Reply
Highlighted
Partner
Partner

 HI

it seems you are confusing 

set analysis from regular selections , 

set analysis is like making a selection on the field and it's disregarding other selection in the field 

in your case it doesn't matter what you'll choose in the year field it will always return 100 , because it's going to disregard the selection . 

in your case if you want the regular  behavior then you just use sum(Sales) , that way if you select a year you'll get this year result and if you don't select any year you'll get the total of all years , 

if you look for a solution to always display the max year from available years  you can use 

sum({<Year = {"$(=max(Year))"}>}Sales)

View solution in original post