How to extract a part of a string in alteryx
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi all,
Im trying to find a good formula to extract a part of a string based on 2 conditions, wherever in the string they can be. This means that the element I need is not located in a specific position of the string (that's why I can't use Text to Columns), but it always contains the term "Store" at the beggining, followed by a number. That whole term (store + number) is contained between to " _ " symbols. Is there any formula in Alteryx that could do this, despite where in the string that would be?
Thank you!!
Solved! Go to Solution.
- Labels:
- Transformation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Patricia2,
you can achieve this using the RegEx Tool.
Example:
Input | Output |
random asdfjklasdjfkl _Store939393_random text | Store939393 |
Configuration:
what does the expression do?
.* = some random stuff
_()_ = this is the instresting part, it starts and ends with underlines
and we are looking for a text inside the underlines, that contains "Store" and \d+ aka a number.
Workflow attached. Let me know if this helped.
Regards
Alex
 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
It worked! thank you
