REGEX - Beginner
- 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,
Trying to remove all the characters(number : #) before the string in the name column and email column. Tried using the Data cleansing tool not bringing the desired result.
Any help would be much appreciated
Solved! Go to Solution.
- Labels:
- Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
HI @suby
Did you try using the formula tool with the expression,
regex_replace([My field], '.*#', '')
I think this should work. Just need to update the field name for Name and again for Email.
Thanks,
Philip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @suby
If you have multiple fields to work on. You can use mutli-field formula
Formula:
REGEX_Replace([_CurrentField_], "(.*)#(.*)", "$2")
Hope this helps 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
is that using the Regex tool ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks this works great but is there a way to combine name and email in one formula.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you both how to accept both as a solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry can i ask you what exactly the syntax do after the current field.
regex_replace([_CurrentField_], '.*#', '')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @suby
Sure. You can see the attached workflow.
Here is the explanation of the config
1. Select all text field.
2. Select the fields on which you want to apply formula.
3. Formula
[_CurrentField_] are the field selected
Output:
Here is a helpful resource
https://community.alteryx.com/t5/Interactive-Lessons/Multi-Field-Formulas/ta-p/424422
Hope this helps 🙂 And yes you can accept multiple solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you so much i got your point on multifield formula tool. could you please explain this bit "(.*)#(.*)", "$2" to have an understanding.
REGEX_Replace([_CurrentField_], "(.*)#(.*)", "$2")
Many thanks
