Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
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
Top Solution Authors