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

Variables are not read by the script

I got this error after running this script:

 

Let vMinDate=NUM('24/02/2021');
Let vMaxDate=NUM('27/02/2021');

TEMP:
Load
If(RowNo()=1, Date( $(vMinDate),'DD/MM/YYYY'), Date( $(vMinDate) + RowNo(),'DD/MM/YYYY')) as Tempdate
AutoGenerate(1)
while $(vMinDate) + RowNo() < $(vMaxDate);

 

Unexpected token: ')', expected one of: ',', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', 'like', ...
ERROR:
TEMP:
Load
If(RowNo()=1, Date( ,'DD/MM/YYYY'), Date( + RowNo(),'DD/MM/YYYY') >>>>>>)<<<<<< as Tempdate
AutoGenerate (1)
while + RowNo() <

# variables

Labels (1)
1 Solution

Accepted Solutions
Or
MVP
MVP

I suggest you run this in debug mode and see what the problem is. In this case, I think you'd need date#() rather than date(), though?

View solution in original post

3 Replies
Or
MVP
MVP

You can't num() on this string... it doesn't have a valid numeric representation. You'd have to make that value a date first if you want to use num() on it. Currently it's evaluating to null, as you can see in debug mode.

Or_0-1620729537279.png

 

 

Nourrahmcnean
Contributor III
Contributor III
Author

Thanks for your answer, I changed  num() to Date() but i got the same error 

Let vMinDate=Date( '24/02/2021','DD/MM/YYYY');
Let vMaxDate=Date( '27/02/2021','DD/MM/YYYY');

TEMP:
Load
If(RowNo()=1, $(vMinDate), $(vMinDate) + RowNo() ) as Tempdate
AutoGenerate (1)
while $(vMinDate) + RowNo() < $(vMaxDate);
Unexpected token: ')', expected one of: ',', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', 'OPERATOR_STRING_CONCAT', 'like', ...
TEMP:
Load
If(RowNo()=1, , + RowNo() >>>>>>)<<<<<< as Tempdate
AutoGenerate (1)
while + RowNo() <
Or
MVP
MVP

I suggest you run this in debug mode and see what the problem is. In this case, I think you'd need date#() rather than date(), though?