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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

i created variables...but they did not show..please solve the issue

Sales:

LOAD OrderID,

     ProductID,

     Product,

     CustomerID,

     EmployeeID,

     OrderDate,

     Margin,

     Sales,

     Cost,

     Quantity

FROM

C:\Users\PITCHAIAH\Desktop\Sales.xls

(biff, embedded labels, table is [Orders$]);

Sales1:

LOAD *

Resident Sales

Order By OrderDate;

DROP Table Sales;

LET vMinDate=Num(Peek('OrderDate',0,Sales1);

LET vMaxDate=Num(Peek('OrderDate',-1,'Sales1');

15 Replies
JonnyPoole
Former Employee
Former Employee

You are missing closing ')' and single quotes in the first

LET vMinDate=Num(Peek('OrderDate',0,'Sales1'));

LET vMaxDate=Num(Peek('OrderDate',-1,'Sales1'));

But do you want a date instead ? just checking...

LET vMinDate=Date(Peek('OrderDate',0,'Sales1'));

LET vMaxDate=Date(Peek('OrderDate',-1,'Sales1'));

Not applicable
Author

after closing the ')'.still i did not get them

Not applicable
Author

Hi Raja,

You're using a "load * resident" which is causing an auto-concatenation of Sales1 in Sales.

Sales1 is not actually created and cannot be referenced in the peek function.

Simply add a "NoConcatenate" before loading Sales1 and it will work.

Not applicable
Author

Thank You

Not applicable
Author

i got an error from this code .date($(varMinDate) + rowno() – 1) As TempDate

Not applicable
Author

TempCalendar:

Load

date($(vMinDate) + rowno() – 1) As TempDate

Autogenerate

$(vMaxDate) – $(vMinDate) + 1;

Please solve the issue

JonnyPoole
Former Employee
Former Employee

you said the error was :  date($(varMinDate) + rowno() – 1) As TempDate

but the code says:   date($(vMinDate) + rowno() – 1) As TempDate

varMinDate <> vMinDate

Did you post the wrong error or code ?  Can you post your whole script ?

Not applicable
Author

Sales:

LOAD OrderID,

     ProductID,

     Product,

     CustomerID,

     EmployeeID,

     OrderDate,

     Margin,

     Sales,

     Cost,

     Quantity

FROM

C:\Users\PITCHAIAH\Desktop\Sales.xls

(biff, embedded labels, table is [Orders$]);

NoConcatenate

Sales1:

LOAD *

Resident Sales

Order By OrderDate;

DROP Table Sales;

LET vMinDate=Num(Peek('OrderDate',0,Sales1));

LET vMaxDate=Num(Peek('OrderDate',-1,'Sales1'));

TempCalendar:

Load

date($(vMinDate) + rowno() – 1) As TempDate

Autogenerate

$(vMaxDate) – $(vMinDate) + 1;

JonnyPoole
Former Employee
Former Employee

i noticed you never added the single quotes (around Sales1)  i mentioned in vMinDate definition. Can you try that  ?

LET vMinDate=Num(Peek('OrderDate',0,'Sales1'));

LET vMaxDate=Num(Peek('OrderDate',-1,'Sales1'));