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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
TheresaB_4
Contributor III
Contributor III

Top row using date fields(select the latest date)

Hi everyone,

In SQL you can use ROW_NUMBER() to get the top row sorting desc
How do we do this in Qlik Sense?
I have a meter Reading, but with several lines and MeterReadDate. I only want it to show the latest ReadingDate.
I have tried using Max but it still shows multiple lines.

Account Profiel Meternummer High-Low meterdate ReadingDate MeterRead previous Meter read
871687120055493509 _2A ZASN009683167610 High 17/10/2023 07/11/2023 312433 284233
871687120055493509 _2A ZASN009683167610 High 01/01/2023 02/11/2023 269764 242421
871687120055493509 _2A ZASN009683167610 High 01/04/2023 05/04/2023 284233 269764
871687120055493509 _2A ZASN009683167610 High 01/07/2022 16/02/2023 242421 228699
871687120055493509 _2A ZASN009683167610 High 11/10/2021 16/02/2023 228699 228698
Labels (1)
1 Solution

Accepted Solutions
jochem_zw
Employee
Employee

Remove the readingdata as a dimension from your table and add it to a table (chart) as a expression like below: 

=Only({$<ReadingDate={"$(=Date(Max(Total ReadingDate),'DD/MM/YYYY'))"}>}ReadingDate)

View solution in original post

3 Replies
Ahidhar
Creator III
Creator III

use Order By ReadingDate desc;

jochem_zw
Employee
Employee

Remove the readingdata as a dimension from your table and add it to a table (chart) as a expression like below: 

=Only({$<ReadingDate={"$(=Date(Max(Total ReadingDate),'DD/MM/YYYY'))"}>}ReadingDate)

TheresaB_4
Contributor III
Contributor III
Author

Thank you so much