Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
hov
Contributor II
Contributor II

get max from defined set

Im trying to get the second highest date from my selected date.

My approach is to filter all less than selected date number and get the max from that.

count({1<date_num={"<$(=Max(date_num))"}, date_num2=max(date_num2)>}ReportName)

Labels (3)
1 Reply
RafaelBarrios
Partner - Specialist
Partner - Specialist

Hi @hov 

Take a look to this post I replied a couple of days ago.

it’s a bit different because wasn’t using date format but text as date

https://community.qlik.com/t5/New-to-Qlik-Sense/Get-second-max-value-of-a-text-value/td-p/1988828

I would try

var1
=Max(DateField)

var2
=max({< field-={"$(var1)"} >}field)

Use the = sign when defining the variables


Now you should have the two 
highest date


But Here I don’t understand what you are trying to do

count({< date_num={"<$(=Max(date_num))"}, date_num2=max(date_num2)>}ReportName)

but following your expression, should be
count({< date_num={"<$(var1)"}, date_num2={'$(var2)'}>}ReportName)


hope this works for you

best,