Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jose_vargas
Creator
Creator

Calculation of variation for 2 years

Hi Community.

This time I am writing because I have a problem to calculate the variation in a table.

The formula is not a problem. My problem is that I need the variation of only 2 years to be shown, even if I have selected more than years. For example on my sheet I have selected the years 2015, 2016, 2017 and 2018 ... I just need to show the variation from 2017 to 2018.

qlik-1.jpg

Labels (2)
5 Replies
aslam24196
Contributor III
Contributor III

Hi Jose,

 

You can use set analysis to restrict the Year to be considered for Expression.

Assuming the formula You have used is Sum(Variance).

You can instead Use Sum({<Year={2017,2018}>}Variance) to display only for 2017 and 2018.

jmartineze
Partner - Creator
Partner - Creator

hi, try with    Sum({<Year={$(=max(Year)),$(=max(Year)-1)}>} FieldName ) and select the chart option detach.

jose_vargas
Creator
Creator
Author

Hi.. Its Works, but the value show in all years like a 0. How I do to hide the value from the  every year less tnah the last.... Need to show the calculation in the las column.

 

thanks

qlik-2.jpg

jose_vargas
Creator
Creator
Author

Community... Im using the "max" for the field year.

For example Im calculate the sum from the max year in my case is "2019", and only show values in this year, because this sentence works like a "IF". qlik-3.jpg

Sum( {$<Año={'$(=Max(Año))'}>} Cantidad_Transito)

How I do, to show this value for all the year, I mean, that the calculate from 2019 have to show in the other years.. .Something like this.

qlik-4.jpg

Thanks a lot.

jmartineze
Partner - Creator
Partner - Creator

Puedes quitar el año como dimensión y añadir tantas expresiones como necesites, utilizando el set análisis controlas las expresiones para cada año.