Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
pratik_advani
Contributor
Contributor

Master Calendar

Hi, can anyone tell me where and when master calendar is used? Also state its advantages.

4 Replies
ashfaq_haseeb

Not applicable

jpenuliar
Partner
Partner

its_anandrjs

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