Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
ARUNKRISHNAN
Contributor
Contributor

Want max year and prior to max year

First i want to display only the max and prior to mac year datas 

2 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

HI @ARUNKRISHNAN ,

What do you expect us to advise you on?

Make sure you provide us some description so we can know what tools you are working with and what business scenarios we are talking about. 

There are 1000s possible answers to your question and If you are talking about Qlik Sense we dont know if you just want to load data for max and prior to max year data or whether you want to load all data but only show by default max and max-1 on UI?

You may as well describe your Qlik (sense??) knowledge as our answer can be as simple as:

  • create reference calendar and use set analysis with flags MaxYear = 0 and -1...

I guess ball is in your corner know - please invest time to properly and fully describe your scenario, please consider that we are not sitting next to you and we cannot read your mind so provide us with all required steps to replicate your scenario so we can help you.

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
tresesco
MVP
MVP

max year   -> max(year)
prior year  ->  max(year)-1, or max(year,2)  // when there is a possibility of not having all years data

So, in a scenario when you want to show only last two years data, one easier way could be like :

Sum({<year={'$(=max(year))' , '$(=max(year,2))'} >}Sales)