Alteryx Designer Desktop Discussions

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

IF Contains

Prasant
6 - Meteoroid

I am new to Alteryx , trying to apply few formulas but not finding a solution

 

Q : IF Column A contains "text" Update "text" Column B

 

can anybody help me

9 REPLIES 9
JagdeeshN
12 - Quasar
12 - Quasar

Hi @Prasant ,

 

Is this what you are looking for:-

 

if contains([Column A],"Text") then "text"
else [Column B]
endif

 

This formula checks if 'Column A' contains the word 'text' and if true assigns column B that value.

 

Best,

Jagdeesh

atcodedog05
22 - Nova
22 - Nova

Hi @Prasant 

 

Your formula would go like and assign it to Column B

 

IF contains([Column A],"Text") 

Then "Text"

Else [Column B] Endif

 

Hope this helps 🙂 

 

Here is a resource which will help you get a better understanding

 

https://community.alteryx.com/t5/Interactive-Lessons/Diving-Into-Expressions/ta-p/98817

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

 

 

Prasant
6 - Meteoroid

Thank you, I applied same and i was expecting "text" should update in Column B but it is updating "False"

 

Prasant_1-1611855401594.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @Prasant 

 

Flow is a Boolean datatype you need to create a new column of string datatype and later change the name using a select tool.

JagdeeshN
12 - Quasar
12 - Quasar

@Prasant 

 

You would need to assign the value to COlumnB.

 

Please refer the workflow attached.

Prasant
6 - Meteoroid

I have to apply this multiple time 

 

like 

 

IF Column A Contains "Text 1" then Column B "Text 1"

IF Column A Contains "Text 2" then Column B "Text 2"

etc..

 

in this cases what should be the logic to apply

DenisZ
11 - Bolide

@Prasant , then you would need to apply conditional function. Please refer to Conditional Functions | Alteryx Help

 

Hope it helps. 

trivedi_namrata
5 - Atom

In the formula above, what if I want else "Blank".  How should I update the formula if the desired result is not found, I want it to leave the column with blank.

 

IF contains([Column A],"Text") 

Then "Text"

Else [Column B -- I want this to be blank if the condition is not met] Endif

trivedi_namrata
5 - Atom

 

Below formula worked for "Blank".  Let me know if anyone has any other thoughts.

 

if contains([Internal Vs External],"External") then "External"
else " "
endif

Labels