Alteryx Designer Desktop Discussions

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

Finding a substring within a string

sudeshnasen
7 - Meteor

Column 1 is what I have and column 2 is what I require. How do I do it in Alteryx?

 

Column 1Column 2
H1 CHN, B241CHN
H1 CHN, All- includedCHN
H2 BRZ-AMER, allAMER
CHN, excluding HKTCHN
H2 AMERAMER
H1-453 AMER, AllAMER
Q2- 33, LATAM, B241LATAM

 

The number of items can increase but the substrings I want will be either "CHN", "AMER" or "LATAM". 

 

1 REPLY 1
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @sudeshnasen,

 

There are multiple ways to do this, i've used a regex_replace function inside a formula tool:

 

REGEX_Replace([Column 1], '.*(CHN|AMER|LATAM).*', '$1')

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

Labels