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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
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)) ?