Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

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
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
Highlighted
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.

Highlighted
Partner
Partner

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

Highlighted
Creator
Creator

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

Highlighted
Creator
Creator

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.

Highlighted
Partner
Partner

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.