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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Master Calendar

hi all,

anyone has a master calendar where I can plug in a start date and end date and generate master calendar with all possible fields such as quarter, month, year, year to date..etc..

Labels (1)
1 Solution

Accepted Solutions
6 Replies
Anonymous
Not applicable

load

year(Date column) as Year,

Month(Date Column) as month,

WEEK(Date Column) as WEEK

DAY (Date Column) as DAY

'Q' & CEIL((MONTH)/3) AS QUARTER

THIS IS GENERAL CALENDAR IT USE IT OTHER WISE SEARCH IN QLIK COMMUNITY HAVE THE MASTER CALENDAR

settu_periasamy
Master III
Master III

tamilarasu
Champion
Champion

Hi,

Try the below one,

SET DateFormat='D/M/YYYY';

LET vMinDate = Num('01/01/2016');

LET vMaxDate = NUm('31/12/2016');


TempCalendar:

LOAD

  $(vMinDate) + IterNo() - 1 as Num,

  Date($(vMinDate) + IterNo() - 1) as TempDate

AutoGenerate

  1 While $(vMinDate) + IterNo() -1 <= $(vMaxDate);

MasterCalendar:

LOAD

  TempDate as Date,

  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,

  'Q' & Ceil(Month(TempDate)/3) & '-' & Year(TempDate) as QuarterYear,

  MonthName(TempDate) as MonthYear,

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

Resident TempCalendar

Order By TempDate ASC;

DROP Table TempCalendar;

Anonymous
Not applicable

Try the above logic

ramasaisaksoft

Hi Alec,

Default code for Master Calendar

Let VarMinDate = Num(Peek('OrderDate',0,'OrdersQuery'));

LET VarMaxDate = num(peek('OrderDate', -1, 'OrdersQuery'));

LET VarToday = num(Today());

TempCalendar:

LOAD

$(VarMinDate) +  RowNo() -1 as DateNum,

Date($(VarMinDate) +  RowNo()-1 ) as TempDate

AutoGenerate

$(VarMaxDate) - $(VarMinDate);

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

Resident TempCalendar;

DROP Table TempCalendar;