Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
Not applicable
Author

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
deepakk
Partner - Specialist III
Partner - Specialist III

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
Author

Hi,

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

Good luck!

Rainer

jagan
Luminary Alumni
Luminary Alumni

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.