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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

MASTER CALENDAR SCRIPT LINE ERROR

I am getting Script Line Error. . Please see the attached File for ERROR Print SCreen. It was working fine uptil now and all of a sudden lsat night gave an error 

TEMP:

LOAD
num(min(ACCTGDTE)) AS MinDate,
num(max(ACCTGDTE)) AS MaxDate
RESIDENT
AcctSumm
;

LET vMinDate
=

peek('MinDate', 0, 'TEMP');

LET

vMaxDate =

peek('MaxDate', 0, 'TEMP');

LET

vToday =

num(

today());

LET

vYesterday =

num(

today()-1);

DROP

TABLE TEMP;


//Returns all rows of data form the first row, '0', to the last, '-1'

//**************************************************Temporary Calendar*************************************************************
TempCalendar:

LOAD

$(vMinDate) +

RowNo() - 1

AS

Num,

date(

$(vMinDate) +

RowNo() - 1)

AS

TempDate

AUTOGENERATE

$(vMaxDate) -

$(vMinDate) + 1;

//Returns number of rows dependent on the number of day between Min-Max

//****************************************************MasterCalendar***************************************************************

MasterCalendar:

//Commonly used date funcitions

LOAD

// Date(TempDate) AS Date, //Links to Data

num(

TempDate)

AS

%DateLink,

num(

TempDate)

AS

Date_Num,

// Week(TempDate) AS Week,

Year(

TempDate)

AS

Year,

Month(

TempDate)

AS

Month,

Num(

Month(

TempDate),'0')

AS

Period,

// Day(TempDate) AS Day,
// Weekday(TempDate) AS WeekDay,
'Q' &

ceil(

month(

TempDate) / 3)

AS

Quarter,

Date(

MonthStart(

TempDate),'MMM-YYYY')

AS

MonthYear,
'Q' &

ceil(

month(

TempDate) / 3)&'-'&

Year(

TempDate)

AS

QuarterYear

RESIDENT
TempCalendar

ORDER

BY

TempDate

ASC
;

DROP

TABLE TempCalendar;

2 Replies
Anonymous
Not applicable
Author

Hi Ray,

It seems that both variables $(vMinDate) and $(vMaxDate) are empty. My suggestion is to check the following section of the code. Evaluate what are you getting in the load statement (MinDate and MaxDate) and then check the variable creation.

TEMP:

LOAD
num(min(ACCTGDTE)) AS MinDate,
num(max(ACCTGDTE)) AS MaxDate
RESIDENT
AcctSumm
;

LET vMinDate
=

peek('MinDate', 0, 'TEMP');

LET

vMaxDate =

peek('MaxDate', 0, 'TEMP');

LET

vToday =

num(

today());

LET

vYesterday =

num(

today()-1);

DROP

TABLE TEMP;


Regards,

Anonymous
Not applicable
Author

Is your field ACCTGDTE a proper QlikView date ? 

Or is it a text representation of a date ?