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

Karl_Spratt
8 - Asteroid

Hi Community,

Need some help please, I'm trying to write a IF Contains, and or IF in the same statement. But getting a Malformed IF Statement

My Formula us 

 

if Contains([Locator], 'KARDEX') THEN 'KARDEX' OR if Contains([Locator], 'KLX') THEN 'Warehouse'
OR
IF [Locator]='BRD1..' THEN 'BIBAK' ELSEIF [Locator]='KLX-NYK..' THEN 'YUSEN' ELSE 'NUll' ENDIF

 

Picture of Error / formula, and the excel of the locators. 

Any help is appreciated.  TIA  Karl  

3 REPLIES 3
JosephSerpis
17 - Castor
17 - Castor

Hi @Karl_Spratt try this If Contains([Locator], 'KARDEX') THEN 'KARDEX' ELSEIF Contains([Locator], 'KLX') THEN 'Warehouse'
ELSEIF [Locator]='BRD1..' THEN 'BIBAK' ELSEIF [Locator]='KLX-NYK..' THEN 'YUSEN' ELSE Null() ENDIF

echuong1
Alteryx Alumni (Retired)

Is this what you're looking for?

 

Separate all of your conditions with "elseif." The last catchall would fall under the ELSE clause. 

 

echuong1_0-1611758392653.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @Karl_Spratt 

 

Here is an interactive lesson which will give you more understanding in tackling this kind of scenario.

 

https://community.alteryx.com/t5/Interactive-Lessons/Writing-Conditional-Statements/ta-p/98910#done

 

Hope this helps 🙂

Labels