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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with MasterCalendar

Hello,

I get only one(1) line in the master calendar when I load from SQLerror loading image

error loading image

What can be wrong ? The Orders table ReklamationsTid contains several entries of each date.

kindly

Håkan

1 Solution

Accepted Solutions
pover
Partner - Master
Partner - Master

Please upload the script you are using to generate the master calendar to review it.

Also, in these cases it is good to use the debug and go step by step through the creation of the master calendar to make sure the variables are being assigned the correct values to run the autogenerate.

The script should be something like the following:

Min_Max_Dates:
LOAD %Date as Min_Max_DateKey
RESIDENT Transactions
Order by %Date;

LET vMinDate = num(peek('Min_Max_DateKey',0,'Min_Max_Dates'));
LET vMaxDate = num(peek('Min_Max_DateKey',-1,'Min_Max_Dates'));

Calendar:
load Date as %Date,
Date,
year(Date) as Year,
dual('Q' & ceil(month(Date)/3),ceil(month(Date)/3)) as Quarter,
month(Date) as Month,
monthname(Date) as [Month/Year],
week(Date) as Week,
day(Date) as Day,
weekstart(Date) as WeekStart;
LOAD
date($(vMinDate) + recno() - 1) as Date
AUTOGENERATE ($(vMaxDate) - $(vMinDate) + 1);

drop table Min_Max_Dates;

Regards.

View solution in original post

2 Replies
martinpohl
Partner - Master
Partner - Master

Please post the statement from the master calendar

pover
Partner - Master
Partner - Master

Please upload the script you are using to generate the master calendar to review it.

Also, in these cases it is good to use the debug and go step by step through the creation of the master calendar to make sure the variables are being assigned the correct values to run the autogenerate.

The script should be something like the following:

Min_Max_Dates:
LOAD %Date as Min_Max_DateKey
RESIDENT Transactions
Order by %Date;

LET vMinDate = num(peek('Min_Max_DateKey',0,'Min_Max_Dates'));
LET vMaxDate = num(peek('Min_Max_DateKey',-1,'Min_Max_Dates'));

Calendar:
load Date as %Date,
Date,
year(Date) as Year,
dual('Q' & ceil(month(Date)/3),ceil(month(Date)/3)) as Quarter,
month(Date) as Month,
monthname(Date) as [Month/Year],
week(Date) as Week,
day(Date) as Day,
weekstart(Date) as WeekStart;
LOAD
date($(vMinDate) + recno() - 1) as Date
AUTOGENERATE ($(vMaxDate) - $(vMinDate) + 1);

drop table Min_Max_Dates;

Regards.