Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

max date

Hello

It is me again

My sql query returns 3 rows for the same id, see bellow :

Capture.PNG

I would like to keep only one row (max valid from date) ; the first row

any function in Qlik

Thanks

6 Replies
Chanty4u
MVP
MVP

try

=Firstsortedvalue(Field,-Date)

sasikanth
Master
Master

Try this,

Firstsortedvalue(ID,-Aggr(max(Date),ID))

Chanty4u
MVP
MVP

or FirstSortedValue( ID, -aggr(Max(Date)) )

pipuindia99
Creator III
Creator III

max(timestamp(date)) or use firstsortedvalue function

sdmech81
Specialist
Specialist

Hi either this:

=Firstsortedvalue(ID,-Aggr(max(Date),ID))

or u can use firstvalue() function aswell bcs ur data looks already aggregated based on date.

Sachin

master_student
Creator III
Creator III
Author

The field ID in my case : imei_number

Firstsortedvalue(mei_number,-Aggr(max(valid_from),mei_number)) ?