Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

REGEX - Beginner

suby
11 - Bolide

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.

 

suby_0-1606238453830.png

 

Any help would be much appreciated

14 REPLIES 14
atcodedog05
22 - Nova
22 - Nova

Hi @suby 

 

Regex Tool | Parse mode

 

#(.*)

 

Should do the trick.

 

PhilipMannering
16 - Nebula
16 - Nebula

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 

atcodedog05
22 - Nova
22 - Nova

Hi @suby 

 

If you have multiple fields to work on. You can use mutli-field formula

Formula:

 

 

REGEX_Replace([_CurrentField_], "(.*)#(.*)", "$2")

 

 

Hope this helps 🙂

 
suby
11 - Bolide

Hello,

 

is that using the Regex tool ?

suby
11 - Bolide

Thanks this works great but is there a way to combine  name and email in one formula.

suby
11 - Bolide

Thank you both how to accept both as a solution?

suby
11 - Bolide

Sorry can i ask you what exactly the syntax do after the current field.

 

regex_replace([_CurrentField_], '.*#', '')

atcodedog05
22 - Nova
22 - Nova

Hi @suby 

 

Sure. You can see the attached workflow.

 

Here is the explanation of the config

atcodedog05_0-1606242173230.png

 

1. Select all text field.

2. Select the fields on which you want to apply formula.

3. Formula

 

[_CurrentField_] are the field selected

 

Output:

atcodedog05_0-1606242221962.png

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

suby
11 - Bolide

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

Labels