Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

I am getting a parse error at chart 243 malformed if statement. What is wrong?

Marcegon
8 - Asteroid

IF DATETIMEPARSE([End_date], "%Y-%m-%d") >= DATETIMEADD(DATETIMENOW(), -7, "days") THEN IF [Involvement] = "No Spend" OR [Involvement] = "Support only" THEN "Not required"
ELSEIF [Attachments] = "Budget" THEN "Completed" Else "Missing"
ENDIF

4 REPLIES 4
NexBK
7 - Meteor

There are two IF statements, but only one "ELSE" and one "ENDIF".

As shown in the picture, I recommend you to change "THEN IF" to "ELSEIF" in the middle.

 

NexBK_1-1660009498831.png

IF DATETIMEPARSE([End_date], "%Y-%m-%d") >= DATETIMEADD(DATETIMENOW(), -7, "days")
AND ([Involvement] = "No Spend" OR [Involvement] = "Support only") THEN "Not required" ELSEIF 
DATETIMEPARSE([End_date], "%Y-%m-%d") >= DATETIMEADD(DATETIMENOW(), -7, "days")
AND [Attachments] = "Budget" THEN "Completed" Else "Missing"
ENDIF

 

 

 

Marcegon
8 - Asteroid

Thank you!  ELSEIF breaks the code for whatever reason.  Any other suggestion?

 

NexBK
7 - Meteor

I revised what I posted a little while ago. Would you like to try again?

Marcegon
8 - Asteroid

It worked!  Thank you so much

Labels
Top Solution Authors