We are currently experiencing an issue with Email verification at this time and working towards a solution. Should you encounter this issue, please click on the "Send Verification Button" a second time and the request should go through. If the issue still persists for you, please email support@alteryx.com for assistance.

Alteryx Designer Discussions

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

Malformed If Statement

altercat
5 - Atom

altercat_0-1631580865753.png

Could someone explain why this statement is malformed? 

 

2 REPLIES 2
ncrlelia
11 - Bolide

Hi @altercat,

 

Based on your screenshot, you need to remove the space between the 'ELSE' and 'IF', so it will become 'ELSEIF'.

This is because with the space, the 'IF' would need to be followed by 'THEN', 'ELSE' and 'ENDIF'

 

Hope this helps.

 

Cheers,

Lelia

cmcclellan
13 - Pulsar

ELSEIF is one word, not two

 

To be more precise, you have this :

 

ELSE IF [Year of Birth] > 1981 THEN "Millenials"

 

You can do this:

 

ELSEIF [Year of Birth] > 1981 THEN "Millenials"

 

or (maybe, I haven't tried it for a long time), this :

 

ELSE IF [Year of Birth] > 1981 THEN "Millenials" ELSE null() ENDIF

 

Labels