Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

24 rolling months from last date

How can I get my calendar to display 24 rolling months from the last date in my table of dates? Here's the code for the start end endpoints:

tmp:

LOAD

min(OrderDate) as MinDate,

max(OrderDate) as MaxDate

RESIDENT Orders;

LET Start = floor(YearStart(peek('MinDate')));

LET End = floor(???);

Drop Table tmp;

Grateful for any help!

// John

1 Solution

Accepted Solutions
lironbaram
Honored Contributor II

24 rolling months from last date

let End = addmonths(peek('MaxDate,0,tmp),24);

4 Replies
rohit214
Contributor III

Re: 24 rolling months from last date

hi john

try this

tmp:

LOAD

min(OrderDate) as MinDate,

max(OrderDate) as MaxDate

RESIDENT Orders;

LET Start = floor(YearStart(peek('MinDate',-1,tmp)));

LET End = floor(YearStart(peek('MaxDate,0,tmp)));

Drop Table tmp;

thanks

rohit

Not applicable

Re: 24 rolling months from last date

That set the End date of the calendar to january first of the year of the last OrderDate. I need the last date to be 24 months after the last OrderDate.

lironbaram
Honored Contributor II

24 rolling months from last date

let End = addmonths(peek('MaxDate,0,tmp),24);

Not applicable

24 rolling months from last date

That works! Thanks a lot!

Community Browser