Start Free Trial

Alteryx Designer Desktop Discussions

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

How to check if a string is existing in a column

Saravanan13
8 - Asteroid

Hello All,

 

I am looking to write a formula for the below condition.

 

If Address column or City town column contains "Hong kong" then country field should be replaced by "China".

 

Note - the string Hong kong should be case insensitive

 

can anyone assist on this.

 

Input -

 

AddressCity or townCountry
1234 ABCD RD, HONG KONGHONG KONG 11111Hong Kong

 

Output

 

AddressCity or townCountry
1234 ABCD RD, HONG KONGHONG KONG 11111China
2 REPLIES 2
Saravanan13
8 - Asteroid

Sorry forgot to add the full condition

 

If Address column or City town column contains "Hong kong" then country field should be replaced by "China". Else the value should be the same in country column.

Rana_Kareem
9 - Comet

Hi @Saravanan13 ..

 

IF Contains([Address], "Hong Kong")
OR
Contains([City or town], "Hong Kong")
THEN "China"
ELSE [Country]
ENDIF

 

Write it below the Country field in Formula Tool.

Labels
Top Solution Authors