Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Cannot Create variable using LEt ?

Hi,

I have used LET various times for creating variables inside the script.

However, today when I am doing same thing variable is only not getting created.

Dont know how this silly thing is happening. Please help.

Temp:

LOAD

Max(order_date) as MaxDate,

Min(order_date) as MinDate

FROM

$(vQVD)sales.QVD

(qvd);

LET vMaxDate = date(peek(‘MaxDate’));

LET vMinDate = date(peek(‘MinDate’));

Drop Table Temp;

Regards

Bhumika kandpal

4 Replies
Anonymous
Not applicable
Author

your code Looks good, so I woner if the Temp table was created.

Did you check that?

Anonymous
Not applicable
Author

Hello,

thanks for your prompt reply.

I tested using LET in the start of the application with eg: LET a='key';

its not working either.

Regards

prieper
Master II
Master II

What does not work?

Does the variable a have a content?

Is the variable vQVD populated?

Is the $(vQVD)sales.QVD existing?

Is the TempTable created?

Does the field order_date have values?

marcus_sommer

You missed to specify the table from which peek() should grab the values - this is mandatory if peek() is used outside of a load (often it worked without it because peek() used then this last used table but if there is any other load-statement after the min/max table it will fail):

LET vMaxDate = date(peek(‘MaxDate’, 0, 'Temp'));

LET vMinDate = date(peek(‘MinDate’, 0, 'Temp'));

- Marcus