Alteryx Designer Desktop Discussions

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

Extracting Email address from columns

Masond3
8 - Asteroid

Good Afternoon Team, 

Hope your well, i need some assistance 

 

AIM: To extract every Email address from the "Email" Column associated to a given account number and display each email address as an different row

NB : Note that in some instances there can be more than one email to a given account number, this can be separated out either  by a "," or a ";"

 

Scenario 

 

Account NumberEmail
11111abc@abc.com
22222abc@amazon.com; aaa@amazon.com
33333bbb@bbc.com, ccc@bbc.com

 

Expected Outcome 

 

Account NumberEmail
11111abc@abc.com
22222abc@amazon.com
22222aaa@amazon.com
33333bbb@bbc.com
33333ccc@bbc.com

 

looking forward to your assistance 

Regards
Masond3

9 REPLIES 9
IraWatt
17 - Castor
17 - Castor

Hey @Masond3,

Assuming they are always separated with a ; or , your can use the text to columns tool with those as delimiters like this:

IraWatt_1-1656504304858.png

 

IraWatt_0-1656504288488.png

Any questions or issues please ask :)
HTH!
Ira

 

Masond3
8 - Asteroid

@IraWatt  Of course soo simple :). 
I do have a similar scenario but this time an email address in imbedded in text 

 

Account NumberEmailComments
11111abc@abc.comAlt. fax no.: 111-222213188; 111-222250139; masond.d@abc.com
22222abc@amazon.com; aaa@amazon.comOffice ext.5210/4409/5207/5202
other e-mail address 010704@mail.bot.com.pl, alteryx@mail.bot.com.uk

 

 

Expected out come 

 

Account NumberEmail
11111abc@abc.com
11111masond.d@abc.com
22222abc@amazon.com
22222aaa@amazon.com
22222010704@mail.bot.com.pl
22222alteryx@mail.bot.com.uk
IraWatt
17 - Castor
17 - Castor

@Masond3 it is really easy to forget text to column tool can also split to rows 😄 For you second one I would try Regex here's my initial go at it:

IraWatt_0-1656505897773.png

 

 

Masond3
8 - Asteroid

@IraWatt  Just doing some testing and i have noticed a scenario. 

Data Input 

 

Account NumberEmail
33333010704@mail.bot.com.pl;alteryx@mail.bot.com.uk

 

Expected Out come 

 

Account NumberEmail
33333010704@mail.bot.com.pl
33333alteryx@mail.bot.com.uk

 

Current Out come 

 

Account NumberEmail
33333010704@mail.bot.com.pl
33333;alteryx@mail.bot.com.uk

 

 

Is there anyway i can exclude the ";" from the "Email" Column 

IraWatt
17 - Castor
17 - Castor

@Masond3 I've updated the regex:

IraWatt_0-1656509479862.png

I added ;' to the first [] that means it wont allow ,; within the first section of the email. 

Another option is to use the original setup and add a formula to remove the first character if it is a ; 

IraWatt_1-1656509679226.png

 

Masond3
8 - Asteroid

@IraWatt  That issue been resolved, however another issue has appeared:(  (Dam testing) 

 

 

Data Input 

 

Account NumberEmailComments
33333010704@mail.bot.com.pl;alteryx@mail.bot.com.ukTel 2 No. Ext. #5210, #5207, #4409, #5202; Other E-Mail : Amazon@mail.bot.uk/Salesforce@mail.bot.com

 

Expected Out come 

 

Account NumberEmail
33333010704@mail.bot.com.pl
33333alteryx@mail.bot.com.uk
33333Amazon@mail.bot.uk
33333Salesforce@mail.bot.com

 

 

Current Out come 

 

Account NumberEmail
33333010704@mail.bot.com.pl
33333alteryx@mail.bot.com.uk
33333Amazon@mail.bot.uk/Salesforce
IraWatt
17 - Castor
17 - Castor

Hey @Masond3,

I added this formula:

IraWatt_0-1656512035920.png

It will replace any punctuation which is not a . or a @ to a space which should hopefully cover everything. Do you have any email addresses with punctuation? 

 

Masond3
8 - Asteroid

@IraWatt  Unfortunately i do. 

 

Example emails like the following "Amazontrading@trading-amazon.com" do not passed in the end result

IraWatt
17 - Castor
17 - Castor

@Masond3 thats easy enough I just added '-' to the list of things not to replace with spaces here:

IraWatt_0-1656513772241.png

 

Labels