Alteryx Designer Desktop Discussions

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

IF Contains Statement with 2 conditions

dattina2287
8 - Asteroid

hi,

 

i am trying to  use data from two different columns to create a new column but not sure if using IF "Contain" is the best way. Can also use = but i think the issue i'm having is with reading the values in both columns.

 

Here is what i have so far:

 

IF CONTAINS ([Address City],'Atlanta') and  and ([Org Level] = "CCB" THEN "Atlanta-CCB"

 

However, data preview is showing as Null. 

 

Thanks 

5 REPLIES 5
ShankerV
17 - Castor

Hi @dattina2287 

 

Please find the below, 

 

IF CONTAINS([Address City],'Atlanta') and  [Org Level] = "CCB"

THEN "Atlanta-CCB"

ELSE Please fill your 

ENDIF

 

Many thanks

Shanker V

PhilipMannering
16 - Nebula
16 - Nebula

I think in general that should work. You have two "and"s in there, and a missing closing bracket, and a missing else clause. But other than that I would just check that [Org Level] doesn't have any leading or trailing spaces.

 

Feel free to share some dummy data with the workflow so we can troubleshoot.

PhilipMannering
16 - Nebula
16 - Nebula

Hi @dattina2287. Did you manage to solve your issue?

gjjadhao
9 - Comet

@dattina2287 

Actually, Solution by @ShankerV  should work.

IF CONTAINS([Address City],'Atlanta') and  [Org Level] = "CCB"

THEN "Atlanta-CCB"

ELSE Please fill your 

ENDIF

KamenRider
10 - Fireball

Hi @dattina2287 

 

If you are considering multiple records with different options, below is the formula as an example.

 

Sample.PNG

regards,

Kamen

 

Labels