Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
let End = addmonths(peek('MaxDate,0,tmp),24);
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
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.
let End = addmonths(peek('MaxDate,0,tmp),24);
That works! Thanks a lot!