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: 
MK97
Partner - Contributor
Partner - Contributor

Current and previous years calculation

Hello,

I need to calculate values for current year and two previous years.
In example:

If I choose 2019 year Q2, I need to see values for: 2019 year Q1, Q2 AND 2018 year Q1,Q2,Q3,Q4 AND 2017 year Q1,Q2,Q3,Q4.

MK97_0-1635254435210.png

Current calculation : 
SUM({$<[Late payment]={">30<=60"},Year="$(=Max(Year(Date)))","$(=Max(Year(Date))-1)","$(=Max(Year(Date))-2)"}>}[Payment])

 

1 Reply
BenjaminT
Partner - Creator
Partner - Creator

 Hi, As a starter I would consider adding some kind of numeric QuarterNum field to your app, i.e. 2021 Q2 might be equal to 202102. This is probably going to be helpful no matter the solution

You have said above which quarters you want to display when a single quarter is selected. But what about when the user selects multiple quarters, i.e 2019 Q1 and 2018 Q1? What behaviour do you want in that case?

Ben