Alteryx Designer Desktop Discussions

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

NESTED IIF Statement

czjames87
8 - Asteroid

I need some help working on a nested iif statement. Essentially, I need the logic to read like below. How do i get the multiple conditions per IIF statement to work correctly? and how do I get the multiple IIF statements to work together in one formula? I can get one IIF statement to work but not all of them together. 

 

 

IIF([OTYP] = "OUTBOUND,RETURN","OUTBOUND,TRANSFER","OUTBOUND", IIF([OTYP] = "RETURN,OUTBOUND", "RETURN,TRANSFER" , "TRANSFER" IIF([OTYP] = "TRANSFER,OUTBOUND", "TRANSFER,RETURN", "TRANSFER")

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @czjames87 

 

IIF statement goes like

 

IIF(condition, true, false)

Nested IIF(condition, IIF(condition, true, false), false)

Or

IIF(condition, true, IIF(condition, true, false))

 

IIF([OTYP] = "OUTBOUND,RETURN","OUTBOUND,TRANSFER","OUTBOUND", IIF

Has more argument then allowed

 

Hope this helps 🙂

BrandonB
Alteryx
Alteryx

@czjames87 you may also find that writing the conditional out using the following syntax might make it a bit easier to structure

 

IF

THEN

ELSEIF

THEN

ELSE

ENDIF

 

Here is some additional documentation on conditional functions: https://help.alteryx.com/current/designer/conditional-functions

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @czjames87 

 

Cheers and Happy Analyzing 😀

Labels