Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've a Startdate (2013-10-01) and Enddate (2015-01-01). On Load my calendar should be generate a Startdate like Oct 13 and an Enddate like Sep 15.
Regards Stefan
Nachricht geändert durch Stefan Fischer
LET vStart = num(date#('2013-10-01','YYYY-MM-DD'));
LET vEnd = num(date#('2015-09-01','YYYY-MM-DD'));
Calendar:
LOAD Month, Year(Month) as Year;
LOAD
AddMonths($(vStart), iterno() -1) as Month
AUTOGENERATE1)
WHILEAddMonths($(vStart), iterno() -1) <= $(vEnd);
Or perhaps you want this:
LET vStart = num(date#('2013-10-01','YYYY-MM-DD'));
LET vEnd = num(date#('2015-09-01','YYYY-MM-DD'));
Calendar:
LOAD $(vStart) as StartDate, $(vEnd) as EndDate
AUTOGENERATE(1);
Thats fine, but how could it ended on Sep 15?
Sep 15 of which year?
Year of vEnd
Change vEnd:
LET vStart = num(date#('2013-10-01','YYYY-MM-DD'));
LET vEnd = num(date#('2015-09-15','YYYY-MM-DD'));
Calendar:
LOAD $(vStart) as StartDate, $(vEnd) as EndDate
AUTOGENERATE(1);
That's right, but for 2015-09-01 there is not data for load. I've problems to solve my question. Can you help pls.
I'm afraid I don't have any idea anymore what you want. Can you please explain what you want in more detail?
I've add one sample. If i extract year in 2015-01-01, vEnd is dependent of last date. It is possible?
LET vEnd = num(date#(year(month)&'-09-15','YYYY-MM-DD'));
LET vEnd = num(date#(year(month)&'-09-15','YYYY-MM-DD'));
The above gives no result because year(month) can't be calculated because 'month' is undefined. You would have to create a variable named month first.