Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
hkg_qlik
Contributor 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

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Let Statement

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)'

4 Replies
MVP
MVP

Re: Let Statement

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');

MVP
MVP

Re: Let Statement

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
Contributor III

Re: Let Statement

Yes Maxgro.

SQL Select ......

From ......

Where Transaction_Date >= $(vLimit)

MVP
MVP

Re: Let Statement

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)'