Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Remco
Contributor III
Contributor III

Question about finding the value previous to MAX

Good morning all,

I am still learning Qlik and I am running in all kinds of issues. Many of them I solve via this community, others not. Like the next issue:

I am able to find the sum of the value belonging to the max PF_PORTFOLIOPERIOD in the next expression

=Sum({<TYPE = {"FLEETSIZE OL"}, PORTFOLIOPERIOD = {"$(=MAX(PF_PORTFOLIOPERIOD))"}>} ACTUAL)

How can I find the the same belonging to the PF_PORTFOLIOPERIOD just before the max? These periods are always 12 values in the actual example. I cannot just substract a fixed number as these periods are build up as year & month like 201909, 201910, 201911, 201912, 202001 etc. 

 

Thanks!

 

1 Solution

Accepted Solutions
premvihari
Partner - Creator
Partner - Creator

Hi @Remco ,

I just tried to understand what restricting you for not using  "max(PF_PORTFOLIOPERIOD, 2)". This will give second-highest value 

View solution in original post

2 Replies
premvihari
Partner - Creator
Partner - Creator

Hi @Remco ,

I just tried to understand what restricting you for not using  "max(PF_PORTFOLIOPERIOD, 2)". This will give second-highest value 

Remco
Contributor III
Contributor III
Author

I feel stupid... I did not know that, as simple as that. Thanks!