The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Malformed If Statement

altercat
Átomo

altercat_0-1631580865753.png

Could someone explain why this statement is malformed? 

 

2 RESPOSTAS 2
ncrlelia
Bólide

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
Magnetar

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

 

Rótulos
Autores com maior número de soluções