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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Master calender script for displaying all the months for the date format YYYY-MM

Hi,

I have a date field in the format YYYY-MM.I have converted this date field to month and year.Only the months and the year which is there in the particular file loaded will be listed.I want all the months to be listed .I tried using the master calender script.But its not working.

Can Anyone give me the solution?

3 Replies
beck_bakytbek
Master
Master

hi harshuharsh. this is very simple example that helps you to understand this issue (with only working days)

try this code:

 

let vStartDay = date('01/01/2010');
let vEndDate = date('31/12/2016');



for x = vStartDay to vEndDate

tempCalendar:
load $(x) as Date AutoGenerate(1);

next x

NoConcatenate

Working_Calendar:
Load Date, weekday(Date) as WeekDay, week(Date) as Week, Month(Date) as Month, Year(Date) as Year, floor(month(Date)/3)+1 as Qtr

resident tempCalendar

where WeekDay(Date) <> 'Sat' and WeekDay(Date) <> 'Sun';

drop table tempCalendar;

 

i think on the base of this exampe you will be able to solve your problem

beck

jonas_rezende
Specialist
Specialist

Hi, harshuharsh0811.

How is the connection between master calendar and the fact table?

Regards,

Jonas Melo.

Not applicable
Author

Hi,

Its working fine now .Thanks