Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am using below code for master calendar for future data : But is giving error : After this code there is print shot : Not able to find out, Why this error is giving :
QuartersMap:
MAPPING LOAD
rowno() as R_Month,
'Q' & Ceil (rowno()/3) as R_Quarter
AUTOGENERATE (12);
LET varMinDate=NUM('01/04/2021');
LET varMaxDate=NUM('31/03/2022');
TempCalendar:
LOAD
$(varMinDate) + Iterno()-1 As Num,
Date($(varMinDate) + IterNo() - 1) as TempDate
AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);
MasterCalendar:
Load
TempDate,
//As "Recruitment DOJ",
week(TempDate) As R_Week,
Year(TempDate) As R_Year,
Month(TempDate) As R_Month,
Day(TempDate) As Day,
ApplyMap('QuartersMap', month(TempDate), Null()) as R_Quarter,
Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as R_WeekYear,
MonthName(TempDate) As R_YearMonth,
WeekDay(TempDate) as R_WeekDay
Resident TempCalendar
Order By TempDate ASC;
Drop Table TempCalendar;
Thanks
You are relying on automatic date parsing to create varMinDate and varMaxdate. Your script is set up to expect US MM/DD/YYYY dates. '31/03/2022' is not a valid MM/DD/YYYY date so varMaxDate is therefore null.
When creating dates in script or expressions, it is better to use the explicit MakeDate() function.
LET varMaxDate=NUM(MakeDate(2022,3,31));
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
You are relying on automatic date parsing to create varMinDate and varMaxdate. Your script is set up to expect US MM/DD/YYYY dates. '31/03/2022' is not a valid MM/DD/YYYY date so varMaxDate is therefore null.
When creating dates in script or expressions, it is better to use the explicit MakeDate() function.
LET varMaxDate=NUM(MakeDate(2022,3,31));
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com