Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
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
Highlighted

Re: How to get values correspoding to latest date?

Does this looks like what you wanted? (PFA)

Best,

Sunny

View solution in original post

9 Replies
Highlighted
nagaiank
Valued Contributor III

Re: How to get values correspoding to latest date?

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)

Highlighted

Re: How to get values correspoding to latest date?

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

Highlighted
Not applicable

Re: How to get values correspoding to latest date?

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

but I want for each case

Highlighted
Not applicable

Re: How to get values correspoding to latest date?

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

but I want for each case

Highlighted

Re: How to get values correspoding to latest date?

Can you share a sample application?

Best,

Sunny

Highlighted
Not applicable

Re: How to get values correspoding to latest date?

use max(lastdate)

Highlighted
Not applicable

Re: How to get values correspoding to latest date?

Please see attached.

Highlighted

Re: How to get values correspoding to latest date?

Does this looks like what you wanted? (PFA)

Best,

Sunny

View solution in original post

Highlighted
Not applicable

Re: How to get values correspoding to latest date?

Thanks.