6 Replies Latest reply on Aug 4, 2014 8:24 AM by Brandon Avants

# Calculation to find only domain in email address

Maybe it's Monday and that why I'm not able to figure this one out.  So, you have an email address Brandon.avants@XYZcompany.com.  I want to strip everything and have just XYZcompany.

I'd greatly appreciate any assistance.

• ###### 1. Re: Calculation to find only domain in email address

Open the filter box of you measure or dimension and use the 'wildcard tab' and fill in the required info.

2 of 2 people found this helpful
• ###### 2. Re: Calculation to find only domain in email address

That would be nice but there are other company names I need to look for.  I want to use email address to be able to find the company names because that's my only option.

• ###### 3. Re: Calculation to find only domain in email address

I did it in two parts but you could mash it all into one.

First calculated field:

(Copy/paste this)

```MID([Email],FIND([Email],"@" )+1 )  //Get everything after the @

```

Final calculated field:

(Copy/paste this)

```LEFT([Full_Domain],FIND([Full_Domain],"." ) -1 )

```

Thus Domain_Name is the field you want to use.

2 of 2 people found this helpful
• ###### 4. Re: Calculation to find only domain in email address

Toby beat me to it. But since I worked it out, I'll post the other way of doing it (just for variety):

Trim Dot Com

LEFT( [Email],FIND([Email],'.',FIND([Email],'@') )-1)

Everything after @

RIGHT([Trim Dot Com],LEN([Trim Dot Com])-FIND([Trim Dot Com],'@'))

--Shawn

Toby: And I thought you were sticking with Server questions (of the non-mind-reading type).

• ###### 5. Re: Calculation to find only domain in email address

shawnwallwork wrote:

...

Toby: And I thought you were sticking with Server questions (of the non-mind-reading type).

Hehehehe   For the Tableau Alerts Alerter I was working on I played quite a bit with the FIND and REPLACE string functions so this was a no-brainer for me.

• ###### 6. Re: Calculation to find only domain in email address

Toby,

Thank you sooooo much this works PERFECTLY!!!!!  You're my new best friend.