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

error on calender load script

I would like to know my mistake in this script.

//hour

TempCalendar:

LOAD DayStart(TimeStamp($(vMinDate) + (RecNo()/60/24) + (IterNo() -1))) AS DateNumber,

     TimeStamp($(vMinDate) + (RecNo()/60/24) + (IterNo() -1))             AS TempDate   

AUTOGENERATE 1439 WHILE Num($(vMinDate) + IterNo() -1) <= Num($(vMaxDate));

num fun error.PNG.png

8 Replies
Anonymous
Not applicable
Author

vMaxDate is being evaluated as nothing. Where is this set in your code?

Anonymous
Not applicable
Author

Actually both variables are being evaluated as nothing.

If this is being set correctly, try putting your ($vMinDate) in single quotes: '($vMinDate)'

Not applicable
Author

Sorry, here is the complete code

Min_Max_Dates:

LOAD

    Floor(Min(TimeStamp#(eDate, 'MM/DD/YYYY hh:mm'))) AS MinDate,

    Floor(Max(TimeStamp#(eDate, 'MM/DD/YYYY hh:mm'))) AS MaxDate

RESIDENT LinkTable_Temp;

LET vMinDate = FieldValue('MinDate', 1);

LET vMaxDate = FieldValue('MaxDate', 1);

//LET vMinDate = Num(Peek('MinDate', 0, 'Min_Max_Dates'));

//LET vMaxDate = Num(Peek('MaxDate', -1, 'Min_Max_Dates'));

//hour

TempCalendar:

LOAD DayStart(TimeStamp($(vMinDate) + (RecNo()/60/24) + (IterNo() -1))) AS DateNumber,

     TimeStamp($(vMinDate) + (RecNo()/60/24) + (IterNo() -1))             AS TempDate   

AUTOGENERATE 1439 WHILE Num($(vMinDate) + IterNo() -1) <= Num($(vMaxDate));

Calendar:

LOAD

TempDate    AS eDate,

Hour(TempDate) AS CalenderHour,

Minute(TempDate) AS CalenderMinute,

// Standard Date Objects

Date( Floor(TempDate)) AS CalendarDate,

Day(TempDate) AS CalendarDayOfMonth,

Month(TempDate) AS CalendarMonthName,

'Q' & Ceil(Month(TempDate)/3) AS CalendarQuarter,

Year(TempDate) AS CalendarYear,

// Combo Date Examples

'Q' & Ceil(Month(TempDate)/3) & '/' & Year(TempDate) AS CalendarQuarterAndYear,

Year(TempDate) & '/' & 'Q' & Ceil(Month(TempDate)/3) AS CalendarYearAndQuarter,

'Wed ' & DayStart(WeekStart(TempDate) + 3) as CalendarWednesdays

RESIDENT TempCalendar ORDER BY TempDate ASC;

DROP TABLE TempCalendar;

DROP Table Min_Max_Dates;

rustyfishbones
Master II
Master II

Check your Variables for vMinDate and vMaxDate

rustyfishbones
Master II
Master II

Check your Min_Max_Dates table

comment out the Drop Table Min_Max_Dates and then see if it's populating the correct result

Not applicable
Author

by putting the this variable in single quotes '$(vMinDate)' or '($vMinDate)' it has eliminate the error but its not returning 0 rows.

Not applicable
Author

reload script itself is failing with the above error. In Fact this code was working in Qlik 9 version. Because i copied this slice of code from my previous app.

Not applicable
Author

The above code was from Calendar with time (timestamp)