Skip to main content
Announcements
Global Transformation Awards submissions are open! SUBMIT YOUR STORY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Split column

I have a column which stores the email info, can anyone suggest me how do i split into username, @, email address example...

abc@gmail.com, should be splitted as abc, @ , gmail.com into 3 different columns...

1 Solution

Accepted Solutions
rbecher
MVP
MVP

Hi Savitha,

you can use subfield():

LOAD

subfield(email,'@',1) as user,

if(index(email,'@')>0, '@') as at,

subfield(email,'@',2) as domain

...

- Ralf

Astrato.io Head of R&D

View solution in original post

6 Replies
Not applicable
Author

Use the SubField function

=Subfield('abc@gmail.com','@',1) gives you the first field 'abc'

=subfield('abc@gmail.com','@',2) gives you 'gmail.com'

tresesco
MVP
MVP

Try something like:

Load

          SubField(Address, '@' , 1) as Name,

          SubField(Address, '@', 2) as MailProvider,

          '@' as At

rbecher
MVP
MVP

Hi Savitha,

you can use subfield():

LOAD

subfield(email,'@',1) as user,

if(index(email,'@')>0, '@') as at,

subfield(email,'@',2) as domain

...

- Ralf

Astrato.io Head of R&D
its_anandrjs

Use subfield function like


SubField('abc@gmail.com','@',1) as UserName

SubField('abc@gmail.com','@',2) as DName

'@' as Atrate

Hope this helps

Thanks & Regards

Not applicable
Author

thanks but i need only the distinct values

rbecher
MVP
MVP

LOAD DISTINCT... ?

Astrato.io Head of R&D