Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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...

Labels (1)
1 Solution

Accepted Solutions
rbecher
Partner - Master III
Partner - Master III

Hi Savitha,

you can use subfield():

LOAD

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

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

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

...

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine

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'

tresB
Champion III
Champion III

Try something like:

Load

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

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

          '@' as At

rbecher
Partner - Master III
Partner - Master III

Hi Savitha,

you can use subfield():

LOAD

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

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

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

...

- Ralf

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine
its_anandrjs
Champion III
Champion III

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
Partner - Master III
Partner - Master III

LOAD DISTINCT... ?

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine