Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
hic
Former Employee
Former Employee

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

View solution in original post

1 Reply
hic
Former Employee
Former Employee

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