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: 
Not applicable

How to get values correspoding to latest date?

Hi,

I have data in source table as below

sample data for eg:

                                  

FormIDLastDateNoEntriesSumOld
HYT905452618/06/2007
  00:00
198802/11/2013
  00:00
HYT905452718/04/2012
  00:00
5849402/11/2013
  00:00
HYT905452818/05/2012
  00:00
1002/11/2013
  00:00

I need to show output in qvw as below

                 

FormIDLastDateNoEntriesSumOld
HYT905452818/05/2012
  00:00
1002/11/2013
  00:00

so, I need to show the rows which have latest  'LastDate'

Please can anyone suggest me how to do this.

Thanks.

1 Solution

Accepted Solutions
sunny_talwar

Does this looks like what you wanted? (PFA)

Best,

Sunny

View solution in original post

9 Replies
nagaiank
Specialist III
Specialist III

If the LastDate field has no duplicate values, you may use the following expressions:

FirstSortedValue(ID,-LastDate)

FirstSortedValue(LastDate,-LastDate)

FirstSortedValue(NoEntries,-LastDate)

FirstSortedValue(Sum,-LastDate)

FirstSortedValue(Old,-LastDate)

sunny_talwar

You can use FirstSortedValue() function in the front end or the script to achieve this.

FirstSortedValue takes the following inputs: see attached image

FirstSortedValue.PNG

Not applicable
Author

thanks. when I am using this it is not showing for each case. Instead showing overall latest values.

but I want for each case

Not applicable
Author

thanks. when I am using this it is not showing for each case. Instead showing overall latest values.

but I want for each case

sunny_talwar

Can you share a sample application?

Best,

Sunny

Not applicable
Author

use max(lastdate)

Not applicable
Author

Please see attached.

sunny_talwar

Does this looks like what you wanted? (PFA)

Best,

Sunny

Not applicable
Author

Thanks.