Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error in creating Calendar

Hi,

I keep getting the following error when QlikView runs the Master Calendar script :-

I've checked the variables exist.  I've checked "DateNumber,", "TempDate," and "DateRowID" are not referenced anywhere else.

Any idea's on what area's I can check?

Script line error:

TempCalendar:

LOAD

39630 + rowno() - 1 AS DateNumber,

date (39630 + rowno() - 1) AS TempDate,

rowno() as DateRowID

AUTOGENERATE

  - 39630 + 1

Cheers,

Laura

18 Replies
simenkg
Specialist
Specialist

Your problem is that varMaxDate is empty.

It probably has something to do with the where statement in your Dates_TMP.

Perhaps if you change the Where clause to :

where num(%DateKey) >2

ORDER BY %DateKey asc;

the number 2 comes from the fact that dates in QlikView is the number of days since 31.12.1899, so 1.1.1900 will be date number 2.

Anonymous
Not applicable
Author

Thank-you but it has been suggested and it did not fix the issue ☹

Laura Castagna

Business Systems and Process Analyst, NSW Business Chamber

140 Arthur Street North Sydney NSW 2060

Tel: 02 9458 7804 | Mob: 0429 486 934 | Web: www.nswbusinesschamber.com.au<http://www.nswbusinesschamber.com.au>

Twitter<http://www.twitter.com/nswbc> | Facebook<https://www.facebook.com/NSWBusinessChamber> | LinkedIn<http://www.linkedin.com/company/388425?trk=saber_s000001e_1000> | YouTube<http://www.youtube.com/nswbctv>

<http://www.nswbusinesschamber.com.au/>

Proud supporter of:

<http://acci.headsup.org.au/>

sasiparupudi1
Master III
Master III

your varMaxDate is null

check if the following populate the value properly into the varable

Let varMaxDate = Num(Peek('%DateKey',0-1,'Dates_TMP'));

hth

Sasi

simenkg
Specialist
Specialist

Change from:

Dates_TMP:

Load

if(IsNull(%DateKey),makedate(1900,1,1),%DateKey) as %DateKey

RESIDENT Facts

where if(IsNull(%DateKey),makedate(1900,1,1),%DateKey) <>makedate(1900,1,1)

ORDER BY %DateKey;

to:

Dates_TMP:

Load

max(%DateKey) as maxDateTemp

RESIDENT Facts;

and

Let varMinDate = Num(Peek('%DateKey',0,'Dates_TMP'));

Let varMinDate = Num(MakeDate(2008,7,1));

Let varMaxDate = Num(Peek('%DateKey',0-1,'Dates_TMP'));

To:

Let varMinDate = Num(MakeDate(2008,7,1));

Let varMaxDate = Num(Peek(maxDateTemp,0,'Dates_TMP'));

Not applicable
Author

Hi,

I think your variable storing END DATE is not in num format.

Please convert the enddate variable into num and try.

Anonymous
Not applicable
Author

Where should I place this? At the very start?

Laura Castagna

Business Systems and Process Analyst, NSW Business Chamber

140 Arthur Street North Sydney NSW 2060

Tel: 02 9458 7804 | Mob: 0429 486 934 | Web: www.nswbusinesschamber.com.au<http://www.nswbusinesschamber.com.au>

Twitter<http://www.twitter.com/nswbc> | Facebook<https://www.facebook.com/NSWBusinessChamber> | LinkedIn<http://www.linkedin.com/company/388425?trk=saber_s000001e_1000> | YouTube<http://www.youtube.com/nswbctv>

<http://www.nswbusinesschamber.com.au/>

Proud supporter of:

<http://acci.headsup.org.au/>

Anonymous
Not applicable
Author

How do I do this please?

Laura Castagna

Business Systems and Process Analyst, NSW Business Chamber

140 Arthur Street North Sydney NSW 2060

Tel: 02 9458 7804 | Mob: 0429 486 934 | Web: www.nswbusinesschamber.com.au<http://www.nswbusinesschamber.com.au>

Twitter<http://www.twitter.com/nswbc> | Facebook<https://www.facebook.com/NSWBusinessChamber> | LinkedIn<http://www.linkedin.com/company/388425?trk=saber_s000001e_1000> | YouTube<http://www.youtube.com/nswbctv>

<http://www.nswbusinesschamber.com.au/>

Proud supporter of:

<http://acci.headsup.org.au/>

tripatirao
Creator II
Creator II

Hi

Go through this link you will get more information

https://community.qlik.com/docs/DOC-8843

Anonymous
Not applicable
Author

Thank you

Sent from my iPhone