Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to show max values row in straight table?


Hi,

I have below data in qvw. I need to show only max date row in straight table. can anyone suggest me how to do this. I have used MAX(DATE) but it is not working.

INPUT:

                                         

IDNAMEENTERLEAVEDATEAS NAMEREASON OFFMAX DATE
123ADAMTYRREG21/10/2013
  16:58
XX-01/04/2014
  19:24
123ADAMCSACD21/10/2013
  16:58
XX-19/05/2014
  15:51
123ADAMLGAVE21/10/2013
  16:58
XX-21/10/2013
  16:58

need OUTPUT as below

                    

IDNAMEENTERLEAVEDATEAS NAMEREASON OFFMAX DATE
123ADAMCSACD21/10/2013
  16:58
XX-19/05/2014
  15:51

Thanks.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

if you only have 1 expression, when null Qlik doesn't show the row

if([MAX DATE]=max(TOTAL <ID> [MAX DATE]), [MAX DATE])

View solution in original post

8 Replies
alexandros17
Partner - Champion III
Partner - Champion III

But date is the same for all the records, which one I must choose?

Not applicable
Author

I need max date from MAX DATE column.

JonnyPoole
Former Employee
Former Employee

Hi Amelia,

Here i transformed 'Max Date' as a timestamp format in the QlikView load

Step1.png

Then i use Set Analysis to pre-filter the table to only give me the records where Max Date = max( Max Date)

Step2.png

Load expression

LOAD ID,

    NAME,

    ENTER,

    LEAVE,

    DATE,

    [AS NAME],

    [REASON OFF],

    Timestamp#([MAX DATE],'DD/MM/YYYY hh:mm') AS [MAX DATE]

chart expression

=only(  {<[MAX DATE]={"=[MAX DATE]=timestamp(max( total [MAX DATE]))"}>}  [MAX DATE]  )

dclark0699
Creator
Creator

You'll have to make sure the format ends up matching, but something like this in an expression should return what you want

ONLY({<MAX_DATE = {"$(=MAX(MAX_DATE))"}>} MAX_DATE)

Such as in the attached qvw

Not applicable
Author

when I used table is showing latest max date. there are millions of IDs. I have added sample one ID. how to do this for all IDs max dates. Please help.

Not applicable
Author

when I used table is showing latest max date. there are millions of IDs. I have added sample one ID. how to do this for all IDs max dates. Please help.

maxgro
MVP
MVP

if you only have 1 expression, when null Qlik doesn't show the row

if([MAX DATE]=max(TOTAL <ID> [MAX DATE]), [MAX DATE])

Not applicable
Author

Thanks. That's worked.