Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
gauravgg
Not applicable

how to load max date row from the table ?

hi all

I have the following table

IDDateAmount
00101-Jan-20161000
00102-Feb-20162000
00101-Mar-20164000
00201-Aug-20166000
00201-Dec-20167000

From the above table i have to load only those records which has max date for each ID

the output should be as follows

IDDateAmount
00101-Mar-20164000
00201-Dec-20167000

can anyone help me in this ?

Thanks in advance

4 Replies
sunny_talwar
Not applicable

Re: how to load max date row from the table ?

Try this script:

Table:

LOAD

    ID,

    "Date",

    Amount

FROM [lib://Web]

(html, codepage is 1252, embedded labels, table is @1);

Right Join (Table)

LOAD ID,

  Max(Date) as Date

Resident Table

Group by ID;


Capture.PNG

sunny_talwar
Not applicable

Re: how to load max date row from the table ?

You can also try this:

Table:

LOAD

    ID,

    "Date",

    Amount

FROM [lib://Web]

(html, codepage is 1252, embedded labels, table is @1);

FinalTable:

NoConcatenate

LOAD *

Resident Table

Where ID <> Previous(ID)

Order By ID, Date desc;

gauravgg
Not applicable

Re: how to load max date row from the table ?

thanks sunny

timrogers13
Not applicable

Re: how to load max date row from the table ?

Thanks Sunny.  This helped me out. -Tim