Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
hkg_qlik
Creator III
Creator III

Let Statement

Hi,

I am trying to define a variable as follows:

Let vStartDate = '01-JAN-16';

Let vLimit = 'TO_DATE('$(StartDate)', 'DD-MON-YY')';

When I am trying to load the variables I am getting the following error :

Can someone help me with the correct syntax ?

Regards,

H

1 Solution

Accepted Solutions
maxgro
MVP
MVP

did you try my prev post?

Let vStartDate = '01-JAN-16';

Set vLimit = TO_DATE('$(vStartDate)', 'DD-MON-YY');

trace $(vLimit);    

SQL Select ......

From ......

Where Transaction_Date >= $(vLimit)

or with quote

'$(vLimit)'

View solution in original post

4 Replies
swuehl
MVP
MVP

TO_DATE is not a Qlik script function, and your statement itself does not evaluate to a valid statemten because of the quoting.

Try

Let vLimit = Date#('$(vStartDate)','DD-MMM-YY');

maxgro
MVP
MVP

do you need a vLimit var for an Oracle where clause or something similar?

Let vStartDate = '01-JAN-16';

Set vLimit = TO_DATE('$(vStartDate)', 'DD-MON-YY');

1.png

hkg_qlik
Creator III
Creator III
Author

Yes Maxgro.

SQL Select ......

From ......

Where Transaction_Date >= $(vLimit)

maxgro
MVP
MVP

did you try my prev post?

Let vStartDate = '01-JAN-16';

Set vLimit = TO_DATE('$(vStartDate)', 'DD-MON-YY');

trace $(vLimit);    

SQL Select ......

From ......

Where Transaction_Date >= $(vLimit)

or with quote

'$(vLimit)'