Hi Mark,
Firstly I got this code from google only. You can follow the steps :-
- You can get the calendar from which ever period you wish to as in this below syntax I have given the period from 01 Jan 2012. This entire code will autocreate the calendar from that period.
- Calendar is created with the name MasterCalendar
- Import mastercalendar for joining tables
- Use the orderdate to merge with the dates
- Now you can use this date as a dimension and get the missing values in the chart
- The syntax is :-
LET vMinDate=Num(‘2012-01-01’);
LET vMaxDate=Num(today());
TempCalendar:
Load
date((vMinDate)+rowno()-1,'YYYY-MM-DD') As TempDate
AUTOGENERATE (vMaxDate)-$(vMinDate);
MasterCalendar:
Load
TempDate As OrderDate,
Week(TempDate) As Week,
Year(TempDate) As Year,
Month(TempDate) As Month,
WeekDay(TempDate) as Weekday,
day(TempDate) as Day
resident TempCalendar;
STORE MasterCalendar INTO [D:\CalendarFinal.qvd];
Hope this helps