community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

2 email addresses in the same cell

Asteroid

hello, 

 

I'm cleaning a customer file in which the email address is stored. 

For many records, there are 2 email addresses separated with a comma, a semi-column, a slash (/) or a dash.

 

I wish to keep only the first email address

 

could you please help me? 

 

thanks 

myraim

Alteryx Certified Partner

Hi @msantoso

 

Split the email address with Regex tool and use the select tool to keep first email alone.

 

I have attached my solution. Hope it helps.

 

If you have any queries let me know.

Asteroid

Hi Haroon_sa

 

thanks for this solution. 

I understand that it creates 2 new columns. 

and I need a new step to select one of them. 

 

Is there any way that removes the second email from the original column? 

 

many thanks

Myraim

Highlighted
Alteryx Certified Partner

Hi @msantoso

 

This solution will make sense. Hope this solution is what you exactly need.

 

If you have any queries let me know.

 2.PNG

 

Quasar

Hi @msantoso

 

Following on from what @haroon_sa said - you could do something very similar to remove the email from your original column. You could use the regex_replace formula. This will replace the second email with a blank. You just need to make sure you include whatever separates your two email addresses in the pattern. In this case .\s represent any one character (eg a comma) and a space.

 

Regex email.PNG

 

Hope that helps!

Quasar

Two replies at the same time here. Getword is a lot simpler and definitely a better approach :)

Asteroid

Hi Haroon, 

 

Great function! 

just a little thing and we'll get there; the punctuation is selected with the first word, so I get Adam@gmail.com, (with the comma at the end)

How can I have it removed? 

 

thanks 

Myriam

Alteryx Certified Partner

Hi @msantoso,

 

I guess this much simpler regex will solve your issue. It will just keep the first email adress without any punctuation mark at the end. in square bracket i have given comma, semi-colon,dash and a slash. You can also add any wild characters in that square bracket.

 

mailseparation.JPG 

Regards,

Vishwa

Asteroid

thanks Vishwa! it works fine!

 

Labels