Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
MVP
MVP

Re: max(month) by year

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
Honored Contributor II

Re: max(month) by year

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;

Community Browser