In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

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
Top Solution Authors