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
Script will not working?
TempDate:
Load * Inline [
month
'2013-10-01',
'2015-09-15'
];
LET vStart = num(date#(month,'YYYY-MM-DD'));
LET vEnd = num(date#(year(month)&'-09-15','YYYY-MM-DD'));
Calendar:
LOAD Month, Year(Month) as Year;
//
LOAD
AddMonths($(vStart), iterno() -1) as Month
AUTOGENERATE(1)
WHILE AddMonths($(vStart), iterno() -1) <= $(vEnd);
MasterCalender:
LOAD
Date(Month, 'MM') as mon_MM,
Date(Month, 'MMM YY') as mon_MY
Resident Calendar
That depends of your definition of 'working'. But most likely no, it will not work.
And what's wrong?
What I said before. You didn't define the variable 'month'. Try using the peek function to get the value from the TempDate table instead.
TempDate:
Load * Inline [
month
'2013-10-01',
'2015-09-15'
];
LET vStart = num(date#(peek('month',0),'YYYY-MM-DD'));
LET vEnd = num(date#(peek('month',-1),'YYYY-MM-DD'));
Hi, now it works.
TempDate:
Load * Inline [
minDate, maxDate
2013-10-01, 2015-09-01];
Let vStart = num(date#(Fieldvalue('minDate',1),'YYYY-MM-DD'));
Let vEnd = num(date#(Fieldvalue('maxDate',1),'YYYY-MM-DD'));
DROP Table TempDate;
Calendar:
LOAD Date(Month,'YYYY-MM-DD')as Month, Year(Month) as Year;
LOAD
AddMonths($(vStart), iterno() -1) as Month
AUTOGENERATE(1)
WHILE AddMonths($(vStart), iterno() -1) <= $(vEnd);