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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ineedhelp
Contributor III
Contributor III

Display most recent value based on date selection of date picker

I have this dataset, in this example, when I choose the range of date picker on qlik sense from '27-Oct-24' to '2-Nov-24', what I need is to display the latest value of column population_m, which is '781'. I tried to sum max date but it sum all the value from '27-Oct-24' to '2-Nov-24'

Here is the data set

Area Type flock current_state date_calc age_D age_W mortality_F mortality_M population_f population_m
L4 MI A Growing 27-Oct-24 28 5 1 0 1,154 783
L4 MI A Growing 28-Oct-24 29 5 0 1 1,154 782
L4 MI A Growing 29-Oct-24 30 5 0 0 1,154 782
L4 MI A Growing 30-Oct-24 31 5 1 0 1,153 782
L4 MI A Growing 31-Oct-24 32 5 0 0 1,153 782
L4 MI A Growing 1-Nov-24 33 5 1 0 1,152 782
L4 MI A Growing 2-Nov-24 34 5 0 1 1,152 781

 

Labels (3)
1 Solution

Accepted Solutions
rubenmarin

Hi, you can use FirstSortedValue(population_m,-date_calc)

Max should work also: Only({<date_calc={"=Date(Max(date_calc),'D-MMM-YY')"}>} population_m)

View solution in original post

3 Replies
Vegar
MVP
MVP

Sum ({< date_calc = {'$(=date(maxstring(date_calc))'} >}population_m)

(I am assuming your date_calc is a field and that it is a date value and not only a string. )

rubenmarin

Hi, you can use FirstSortedValue(population_m,-date_calc)

Max should work also: Only({<date_calc={"=Date(Max(date_calc),'D-MMM-YY')"}>} population_m)

ineedhelp
Contributor III
Contributor III
Author

The FirstSortedValue(population_m,-date_calc) work, somehow max is not work as I expected, thank you