Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

View solution in original post

3 Replies
Highlighted
Partner
Partner

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

Highlighted
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

View solution in original post

Highlighted
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.