Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
fmazzarelli
Partner - Creator III
Partner - Creator III

compare value

Hi Community,

I am confused and need support.


I need to compare the data for the field Weight moved in the year 2014 with those of 2015 and represent them through kpi going to highlight the difference between the two years .


I select Year 2015

Green: current year

kpi use an expression  ........Sum(TotalWeight) and data are correct.

Blu: previous year

When I input 2014 (Blu), kpi use an expression  Sum({$ <vPreviousYear={'$(=vCurrentYear)-1)'}>} TotalWeight)

translating

sum all data TotalWeight that have PreviousYear = 2014

but It represents the data of 2015 and NOT 2014.

What escapes me?

I'm Immagine.png

2 Replies
ogster1974
Partner - Master II
Partner - Master II

Try

Sum({$ <Year={'$(=vCurrentYear)-1)'}>} TotalWeight)

Not sure why you need to store previous year as a variable where current year is already set.

To trouble shoot your dashboard

1. use a kpi to display your variable values and check its being set correctly

2. try hard coding the years in your formula and getting it working for 2015/2014 then replace with your variables.

reddy-s
Master II
Master II

Hi Fabio,

Firstly when you are selecting 2015 as you did in the green box, make sure that the blue box does not respond to the selections made by those buttons.

Once you input value into the input box you can directly use the following expression:

Sum({$ < year ={ "$(varInputVariable)" } >} TotalWeight )

Assuming that the variable being updated by the input box is 'varInputVariable'.


Thanks,

Sangram Reddy.