Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Load maximum date only

hi there!

I have question to ask

sample table like this (format date : mm/dd/yyyy):

ID          Name          Date

1           John            1/6/2011

1           John            3/2/2011

1           John            4/20/2011

2           Andy            2/1/2011

3           Jean            3/3/2011

3           Jean            4/7/2011

4           Chris            1/1/2011

what i want is to load the table where the date is maximum date like this :

ID          Name          Date

1           John            4/20/2011

2           Andy            2/1/2011

3           Jean            4/7/2011

4           Chris            1/1/2011

how to solve it? thanks all

Tags (3)
1 Solution

Accepted Solutions
Not applicable

Re: Load maximum date only

Hi,

see also this example for help (Solution by script and by expression in a table)

Good luck!

Rainer

3 Replies
deepakk
Valued Contributor III

Load maximum date only

hi,

Use max function with group by clause to get the reuslt.

Load ID, Name, Date(Max(Date),'mm/dd/yyyy') as Date

from table group by ID, Name;

Deepak

Not applicable

Re: Load maximum date only

Hi,

see also this example for help (Solution by script and by expression in a table)

Good luck!

Rainer

MVP & Luminary
MVP & Luminary

Load maximum date only

Hi,

You can load only Max dates by using the script below

Load

     ID,

     Name,

     Date(Max(Date),'mm/dd/yyyy') as Date

FROM FileName

GROUP BY ID, Name;

Or

You can use

Max(Date) in the expression, by using ID and Name as Dimensions.

Regards,

jagan.