Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, can anyone tell me where and when master calendar is used? Also state its advantages.
Hi,
Check this.
http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar
Regards
ASHFAQ
http://community.qlik.com/blogs/qlikviewdesignblog/2014/02/17/canonical-date
this one from Henric Cronstrom
Hi,
There is many reasons for this
1. You have Date field but rest of the date dimensions Year, Month, Quarter, YearStart, Day, Week etc are not available then you have to use the master calendar.
2. You have no proper Date formatted date field in the data model.
Example Code for the Master Calendar
LET vDateMin = Num(MakeDate(2014,04,05));
LET vDateMax = Floor(Today());
TempCalendar:
LOAD
date($(vDateMin)+IterNo()-1) AS Datefield,
date($(vDateMin)+IterNo()-1) AS TempDate
AUTOGENERATE (1)
WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);
Calendar:
LOAD
Date(TempDate) AS ActionTime,
// Standard Date Objects
Day(TempDate) AS CalendarDayOfMonth,
WeekDay(TempDate) AS CalendarDayName,
Week(TempDate) AS CalendarWeekOfYear,
Month(TempDate) AS CalendarMonthName,
'Q' & Ceil(Month(TempDate)/3) AS CalendarQtr,
Year(TempDate) AS CalendarYr,
// Calendar Date Names
WeekName(TempDate) as CalendarWeekNumberAndYear,
MonthName(TempDate) as CalendarMonthAndYear,
QuarterName(TempDate) as CalendarQuarterMonthsAndYear
RESIDENT TempCalendar ORDER BY TempDate ASC;
DROP TABLE TempCalendar;
Regards
Anand