SOLVED
Finding a substring within a string
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
sudeshnasen
7 - Meteor
03-24-2020
06:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Column 1 is what I have and column 2 is what I require. How do I do it in Alteryx?
| Column 1 | Column 2 |
| H1 CHN, B241 | CHN |
| H1 CHN, All- included | CHN |
| H2 BRZ-AMER, all | AMER |
| CHN, excluding HKT | CHN |
| H2 AMER | AMER |
| H1-453 AMER, All | AMER |
| Q2- 33, LATAM, B241 | LATAM |
The number of items can increase but the substrings I want will be either "CHN", "AMER" or "LATAM".
Solved! Go to Solution.
1 REPLY 1
15 - Aurora
03-24-2020
07:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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')
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
