Alteryx Designer Desktop Discussions

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

IF function with 2 conditions

BillyL14
8 - Asteroid

Hi

How can I can write an IF function where if the value in one column is equal to one of two values, say either A or B, then the value in the next column will change to the figure 1, and be 3 if it is not either to A or B?

I wrote this but I want to include "IE" along with GB.

 

WL1_0-1594651918539.png

 

Thank you

4 REPLIES 4
AngelosPachis
16 - Nebula

Hi there, 

 

Try

 

IF [column of interest]="A" OR [column of interest]]="B" THEN "1" ELSE "3" ENDIF

DavidP
17 - Castor
17 - Castor

You can write:

 

if [DestC] in ("GB","IE") then "3" ELSE "1" ENDIF

Thableaus
17 - Castor
17 - Castor

Hi @BillyL14 

 

Also a good way of doing it would be

 

IF [DestC] IN ("GB", "IE") THEN "1" ELSE "3" ENDIF

 

This would work as well.

BillyL14
8 - Asteroid

thanks to all for your help

Labels