Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

max(month) by year

Hi,

I am trying to do a max month, by year.

but how can i do that in LOAD?

It should return only 2011 DEC and 2012 FEB.

sounds simple, but i'm stuck...

2011 MAR

2011 DEC

2012 JAN

2012 FEB

Thanks.

2 Replies
swuehl
MVP
MVP

NPUT:

LOAD Date#(FIELD,'YYYY MMM') as YearMonth INLINE [

FIELD

2011 MAR

2011 DEC

2012 JAN

2012 FEB

];

LOAD FirstValue(YearMonth) as MaxYearMonth

Resident INPUT

group by year(YearMonth)

order by YearMonth desc;

sushil353
Master II
Master II

try this:

T1:

load * Inline

[

year,month

2011,MAR

2011,DEC

2012,JAN

2012,FEB

];

tab2:

LOAD

year,

max(date(date#(month,'MMM'),'MMM'))

Resident T1

Group By year;