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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Siddhanttomar
Contributor
Contributor

master calendar

error.PNG

where my code is 

Temp:

Load

min([OrderDate]) as minDate,
max([OrderDate]) as maxDate

Resident [Orders];
Let varMinDate = Num(Peek('minDate', 0, 'Temp'));
Let varMaxDate = Num(Peek('maxDate', 0, 'Temp'));

DROP Table Temp;

TempCalendar:

LOAD

$(varMinDate) + Iterno()-1 as Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);

 

MasterCalendar:


Load

*,
If( DayNumberOfYear(OrderDate) <= DayNumberOfYear(Today()), 1, 0 ) as New_Date
;

Load

TempDate AS OrderDate,
week(TempDate) As Week,
Year(TempDate) As Year_Year,
Month(TempDate) As Month_Month,
Day(TempDate) As Day_Day

 

Resident TempCalendar

Order By TempDate ASC;

Drop Table TempCalendar;

1 Reply
rubenmarin
MVP
MVP

Hi, it looks like the variables varMinDate and varMaxDate are not retrieving any value. You can check adding an "Exit Script;" before the "DROP Table Temp;" and check the values of the Temp table.

If this Temp table really has the expected values check the valus stored in the variable, and double-check if fields and variable names are written exactly the same, all in the same case.