Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

URGENT DATE

HI,

THIS MY FILE PLEASE APPLY THE MASTER CALENDER FOR MY FILE I FOLLOWED THE STEPS BUT THERE IS ERROR .

ANY ONE HERE KNOW WHY IT SHOW ME THIS ERROR.

Script line error:
TempCalendar:
LOAD
39097 + rowno() - 1 AS DateNumber,
date(39097 + rowno() - 1) AS
TempDate
AUTOGENERATE
39034 - 39097 + 1

THIS IS MESSAGE PLEASE TELL ME THE REASONS

THIS MY CODE FOR TEMPORARY CALENDAR

TempCalendar:

LOAD

$(varMinDate) + rowno() - 1 AS DateNumber,

date($(varMinDate) + rowno() - 1) AS

TempDate

AUTOGENERATE

$(varMaxDate) - $(varMinDate) + 1;

REGARDS

ABDALLA.



6 Replies
Anonymous
Not applicable
Author

Abdalla,

It looks like you're trying to generate a negative number of rows? 39034 - 39097 + 1 = -62

Make sure that your varMaxDate is larger than your varMinDate.

Not applicable
Author

Hi,

You're right. Already I attached file along with post could you please open it and try to see how the solution will be.

Regards,

Abdalla

Not applicable
Author

Hi Abdullah

try to use the following code to build your calender

let varminDate = num(peek('OrderDate',0,'Order'));

let varmaxDate = num(peek('OrderDate',-1,'Order'));

calender_tmp:

Load

$(varminDate) + rowno() -1 as Num,

date ($(varminDate)+rowno()-1) as TempDate

autogenerate $(varmaxDate) - $(varminDate)+1;

MasterCalender:

load

TempDate as OrderDate,

week(TempDate) as Week,

Year(TempDate) as Year,

Month(TempDate) as Month,

Day(TempDate) as Day

resident calender_tmp order by TempDate;

drop table calender_tmp;



Not applicable
Author

Hi M.OWN,

Thanks bro I applied this code, but still it 's not working and again given error did u checked in your qlikview and it's working,

Regards,

Abdalla

Not applicable
Author

hello

see error coming from my system

Script line error:
calender_tmp:

Load

+ rowno() -1 as Num,

date (+rowno()-1) as TempDate

autogenerate - +1

Not applicable
Author

Hi Abdullah,

there is something wrong with your data, i don't know what exactly Tongue Tied , any way you can replace min & max variable as following line and it will work with you.

let varminDate = num(Date('01/01/2004'));

let varmaxDate = num(date('31/12/2010'));