Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Malformed If Statement

swethav
6 - Meteoroid

Hey I am trying to apply if statement for below condition but I am getting error as Malformed If statement . Please help me .

 

Condition : For posting key = 01 to 19 assign line item 1 . For posting key 40 or 50, assign line item 2..

 

IF ([BSCHL]) >= 01 and ([BSCHL]) <= 19 THEN "Item 1" ELSE IF ([BSCHL]) = 40 or ([BSCHL]) = 50 THEN "Item 2"
else "Null"
ENDIF

 

swethav_0-1600700154844.png

 

5 REPLIES 5
RolandSchubert
16 - Nebula
16 - Nebula

Hi @swethav ,

 

replace "Null" with Null(). The result field is of data type Fixed Decimal, "Null" is a string, so you should use Nul() insteadt.

 

Let me know if it works for you.

 

Best,

 

Roland

Emil_Kos
17 - Castor
17 - Castor

Hi @swethav ,

 

You need to change ELSE IF to ELSEIF

 

IF ([BSCHL]) >= 01 and ([BSCHL]) <= 19 THEN "Item 1" ELSEIF ([BSCHL]) = 40 or ([BSCHL]) = 50 THEN "Item 2"
else "Null"
ENDIF

 

 

swethav
6 - Meteoroid

swethav_0-1600700675882.png

 

Emil_Kos
17 - Castor
17 - Castor

Hi @swethav,

 

please Change else to elseif.

 

RolandSchubert
16 - Nebula
16 - Nebula

Hi @swethav ,

 

missed one correction - you should replace ELSE IF with ELSEIF.

 

Best,

 

Roland

Labels