Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I tried to create master calendar but i couldn't can someone explain what is the issue with script below
T1:
LOAD DATE,
SALES
FROM
[C:\Users\Rashmika\Desktop\qlik docs\MASTER CALENDAR.xlsx]
(ooxml, embedded labels, table is Sheet1);
TEMP:
Load
min(DATE) as mindate,
max(DATE) as maxdate
resident T1;
let Vmindate =NUM(peek('mindate',0,'TEMP'));
let Vmaxdate =NUM(peek('maxdate',0,'TEMP'));
CALENDAR:
load
day(DATE)as Day,
week(DATE)as Week,
month(DATE)as Month,
'Q'&Ceil(month(DATE)/3) as Quarter,
year(DATE)as Year resident T1;
T2:
LOAD
DATE($(Vmindate)+IterNo()-1) as DATE
while($(Vmindate)+IterNo()-1)<= DATE($(Vmaxdate));
The second part should be a preceding load, not a resident load. Like this:
CALENDAR:
load
day(DATE)as Day,
week(DATE)as Week,
month(DATE)as Month,
'Q'&Ceil(month(DATE)/3) as Quarter,
year(DATE)as Year
;
LOAD
DATE($(Vmindate)+IterNo()-1) as DATE
while($(Vmindate)+IterNo()-1)<= DATE($(Vmaxdate));
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
I have already tried the above suggestion before posting the Query but i did not get the data as it has to be @rwunderlich
Below is the image of the table which i got by applying the preceding load
You are missing "Autogenerate 1" in the bottom load. Here is the correct script.
CALENDAR:
load
DATE,
day(DATE)as Day,
week(DATE)as Week,
month(DATE)as Month,
'Q'&Ceil(month(DATE)/3) as Quarter,
year(DATE)as Year
;
LOAD
DATE($(Vmindate)+IterNo()-1) as DATE
AutoGenerate 1
while($(Vmindate)+IterNo()-1)<= $(Vmaxdate);
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com