Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Hevel
Contributor II
Contributor II

Complex Set Analysis : Differences between non-consecutives years

Hello dear Qlik Community,

My need is pretty simple.

Here I have a pivot table displaying some sales through years I have pre-selected in a filter.

{582892C6-7B9C-4660-B912-95BFBC1C77DC}.png

Hevel_1-1634030800222.png

I would like to create a column that calculates the difference between the "dimensional" year and the year that falls behind among the current selected years. 

Something like that :

{81F16EE7-2102-44C7-834A-0440B4EFEAF0}.png.jpg

Finally, and ideally, I would add a conditional statement to hide this column if the "dimensional year" is the last one ( there's no previous year to calculate differences with).

I've tried something with the max and rank functions to identify the previous selected year, but I'm not an expert with set analysis and this case is beyond my current skills.

Thank you for you help !

 

Labels (1)
1 Solution

Accepted Solutions
maxgro
MVP
MVP

Try with the after (or before) function

Sum(Sales) - After(Sum(Sales)) 

View solution in original post

2 Replies
maxgro
MVP
MVP

Try with the after (or before) function

Sum(Sales) - After(Sum(Sales)) 

Hevel
Contributor II
Contributor II
Author

Incredible, I can't believe it works and it was so simple. I'll try to learn more about the inter-record functions in Qlik. 

Thank you !