Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Could you please explain How to create master calendar with example ?
LET varMinDate = AddMonths(Today(),-6); //Num(Peek('DataEvento', 0, 'TabEvento'));
LET varMaxDate = Today(); //Num(Peek('DataEvento', -1, 'TabEvento'));
LET vToday = Num(today());
//*************** Temporary Calendar ***************
TempCalendar:
LOAD
$(varMinDate)+IterNo()-8 AS Num,
Date($(varMinDate)+IterNo()-8,'DD/MM/YYYY') AS TempDate
AUTOGENERATE 1 WHILE $(varMinDate)+IterNo()-8<= $(varMaxDate);
//*************** Master Calendar ***************
MasterCalendar:
NoConcatenate
LOAD
TempDate,
WeekYear(TempDate) * 100 + week(TempDate) AS YearWeek,
WeekYear(TempDate) AS Year,
Year(TempDate) * 100 + month(TempDate) AS YearMonth,
day(TempDate) AS Day,
weekday(TempDate) AS WeekDay
RESIDENT TempCalendar
ORDER BY TempDate Asc;
DROP Table TempCalendar;