Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Error in expression:')' expected

I'm trying to loop through a load script.  I'm getting   "Error in expression:')' expected" on the if statement.  I've tried a number of things with no luck. Any ideas?  Thanks.

let sub = $(sub) + 1;


if ($(sub) = 3 or 5 or 7 or 8 or 10 or 12, let $(FromDate) = $(FromDate) + 31,
if ($(sub) = 2, let $(FromDate) = $(FromDate) + 28, $(FromDate) = $(FromDate) + 30));


if ($(sub) = 3 or 5 or 7 or 8 or 10 or 12, let $(ToDate) = $(ToDate) + 31,
if ($(sub) = 2, let $(ToDate) = $(ToDate) + 28, $(ToDate) = $(ToDate) + 30));


loop

1 Solution

Accepted Solutions
Henric_Cronström
Not applicable

Error in expression:')' expected

You should not use the if-function. Use the IF control statement instead: IF <condition> THEN <statement> END IF.

1 Reply
Henric_Cronström
Not applicable

Error in expression:')' expected

You should not use the if-function. Use the IF control statement instead: IF <condition> THEN <statement> END IF.