# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Cloud Maintenance is scheduled between March 27-30. Visit Qlik Cloud Status page for more details.
cancel
Showing results for
Did you mean:
Partner - Contributor III

## 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:
Year, Sales
2020,100
2019,99
2018,98
];

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

Labels (2)

• ### setAnalysis

1 Solution

Accepted Solutions
Partner - Master III

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)

Partner - Master III

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)

Tags
Community Browser