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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Master calender creation

How can i create master calendar? And for Eg. today, yesterday, day after yesterday how may i extend in mater calendar like this pattern can anyone briefly explain?

2 Replies
sunny_talwar
MVP
MVP

Have you already looked at some of the other posts on related to creation of Master Calendar?

Creating A Master Calendar

yadhunandhanan
Partner - Contributor III
Partner - Contributor III

Hi Rambabu,

Use below links

http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/16/the-master-calendar

http://community.qlik.com/docs/DOC-3858

or Use following script

//***********CREATE VARIABLES***********

LET varMinDate = Num(Peek('Date',0,'TableName'));

LET varMaxDate = Num(Peek('Date',-1,'TableName'));

LET varToday = Num(Today());

//***********TEMPORARY CALENDAR***********

TempDateField:

LOAD

$(varMinDate) + RowNo() -1 as Num,

date($(varMinDate) + RowNo() -1) as TempDate

AutoGenerate

$(varMaxDate) - $(varMinDate) + 1;

//***********MASTER CALENDAR***********

MasterCalendar:

LOAD *,

  TempDate as OrderDate,

  Week(TempDate) as Week,

  Year(TempDate) as Year,

  Month(TempDate) as Month,

  Day(TempDate) as Day,

  WeekDay(TempDate) as WeekDay,

  'Q' & Ceil(Month(TempDate)/3) as Quarter,

  Date(MonthStart(TempDate), 'MMM-YYYY') as MonthYear,

  Week(TempDate)&'-'&Year(TempDate) as WeekYear,

  InYearToDate(TempDate,$(varToday),0) * -1 as CurYTDFlag,

  InYearToDate(TempDate,$(varToday),-1) * -1 as LastYTDFlag

Resident TempDateField

Order By TempDate Asc;

DROP Table TempDateField;