Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mahichowdary
Contributor II
Contributor II

How to create master calendar ?

Could you please explain How to create master calendar with example ?

2 Replies
alexandros17
Partner - Champion III
Partner - Champion III

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;

swuehl
MVP
MVP