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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to show rows which have maximum date?

Hi,

I have input data in SQL table as below

                                                                                                                                                                           

IDEntryNoMonthsSalesEnter DateLeave DateTotal
123242605491515026/08/201226/12/2012750
1232426054921026/01/201326/01/20130
1232426054931015026/02/201326/11/20131500
1232426054941026/12/201326/12/20130
123242605495615026/01/201426/06/2014900
1232426054961026/07/201426/07/20140
123242605497115026/08/201426/08/2014150
1232426054988026/09/201426/04/20150
1232426054991416026/05/201526/06/20162240
123242605500815026/07/201626/02/20171200
1232426055011025226/03/201726/12/20172520
123242605502726226/01/201826/07/20181834
123242605503916026/08/201826/04/20191440
5354353296080178225/10/200625/10/2006782
5354353296081341125/11/200625/01/20071233
5354353296082936225/02/200725/10/20073258
53543532960833448425/11/200725/08/201016456
53543532960841225025/09/201025/08/20113000

I need to show output data table in qvw as below

                    

IDSalesLeave Date
12324216026/04/2019
535435325025/08/2011

so, I need to show the rows only have max Leave Date for each ID

I have used below expression but it is not showing data and showing blank chart.

=FirstSortedValue([Leave Date],-ID)

Please can anyone suggest me how to do this.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

try

FirstSortedValue(Sales, -[Leave Date])

View solution in original post

5 Replies
maxgro
MVP
MVP

try

FirstSortedValue(Sales, -[Leave Date])

Not applicable
Author

may be I need to use below

=FirstSortedValue([Leave Date],-[Enter Date])

Not applicable
Author

Thanks. This works for Sales.

maxgro
MVP
MVP

or this (you said by leave date)

FirstSortedValue([Leave Date], -[Leave Date])

Not applicable
Author

Thanks.