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

Qlikview 11 for Developers pg 296

Hi guys,

I am looking at the book page 296 and it is keep coming back with error message as below.

and the code in the tab is as below

--------------------------------------------------------------------------------------

Temp_Calendar_Range:

LOAD

    Num(Date#(Min([Complete Date]), 'YYYY-MM-DD')) as MinDate,

    Num(Date#(Max([Complete Date]), 'YYYY-MM-DD')) as MaxDate

Resident [Tasks];

   

LET vMinDate = Peek('MinDate', 0, 'Temp_calendar_Range');

LET vMaxDate = Peek('MaxDate', 0, 'Temp_Calendar_Range');

DROP TABLE Temp_Calendar_Range;

[Master Calendar]:

LOAD DISTINCT

    Year(Temp_Date)*100 + Month(Temp_Date) as [Period],

    Year(Temp_Date) as [Master Year],

    Month(Temp_Date) as [Master Month],

    Date(Temp_Date, 'YYYY-MM') as [Year - Month],

    'Q' & Ceil(Month(Temp_Date) /3) as [Quarter]

    ;

   

LOAD DISTINCT

    MonthStart($(vMinDate) + IterNo() - 1)   as Temp_Date   

AUTOGENERATE (1)

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

LET vMinDate = NULL();

LET vMaxDate = NULL();

---------------------------------------------------------

I have copied the entire code in the tab and from solution file and added the entire code into my own dashboard.

what does not make sense to me is that the reason the error message is showing up is because it cannot find the field <<=>

Please help me here!!

and also to be honest I do not understand how below part of the code actually means. could anyone give me some detailed explanation about this?

LOAD DISTINCT

    MonthStart($(vMinDate) + IterNo() - 1)   as Temp_Date   

AUTOGENERATE (1)

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

Thank you!!

2 Replies
swuehl
MVP
MVP

Double check your variables vMinDate and vMaxDate, which seem not to be set correctly.

Maybe try

Temp_Calendar_Range:

LOAD

    Min([Complete Date]) as MinDate,

    Max([Complete Date]) as MaxDate

Resident [Tasks];

  

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

LET vMaxDate = Num(Peek('MaxDate', 0, 'Temp_Calendar_Range'));

swuehl
MVP
MVP

I just had a look at my copy of the book (though it seems to be another revision).

Temp_Calendar_Range:

LOAD

    Num(Date#(Min([Complete Date]), 'YYYY-MM-DD')) as MinDate,

    Num(Date#(Max([Complete Date]), 'YYYY-MM-DD')) as MaxDate

Resident [Tasks];

doesn't make much sense to me. If [Completion Date] shows numeric values,

Temp_Calendar_Range:

LOAD

    Min([Complete Date]) as MinDate,

    Max([Complete Date]) as MaxDate

Resident [Tasks];

should be enough then.

If the field values are pure text values, I think you should either do the Date#() interpretation within the aggregation function or use

Temp_Calendar_Range:

LOAD

    Num(Date#(Minstring([Complete Date]), 'YYYY-MM-DD')) as MinDate,

    Num(Date#(Maxstring([Complete Date]), 'YYYY-MM-DD')) as MaxDate

Resident [Tasks];