Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dcd123456
Creator
Creator

Split one field in multiples rows

Hello

I am trying to load a csv that have email server log, this file have several fields, the receiver field have severeal email address separated by ";". I want to geneate a new record with each receiver email addres, for example i have the next line in the file:

  

datesenderrecipientserversubjet
01/05/2016usr1@pp.comusr2@pp.com;usr3@pp.com;usr4@pp.com;host1xxx

i need to generate a 3 records one for each recipient, all the fields have the same value but the field recipiend have only one recipient.

for example the result of the above line will be:

  

datesenderrecipientserversubjet
01/05/2016usr1@pp.comusr2@pp.comhost1xxx
01/05/2016usr1@pp.comusr3@pp.comhost1xxx
01/05/2016usr1@pp.comusr4@pp.com;host1

xxx

anybody know how i can split one field in three new records

thanks in advance for your help

best regards

dcd

1 Solution

Accepted Solutions
rahulpawarb
Specialist III
Specialist III

Hello,

Trust that you are doing well!

Please refer below given sample script:

Data:

LOAD date, sender, SubField(recipient, ';') AS recipient, server, subject;

LOAD * INLINE [

date, sender, recipient, server, subject

01/05/2016, usr1@pp.com, usr2@pp.com;usr3@pp.com;usr4@pp.com, host1, xxx

];

Also refer the application file attached herewith.

Regards!

Rahul

View solution in original post

4 Replies
rahulpawarb
Specialist III
Specialist III

Hello,

Trust that you are doing well!

Please refer below given sample script:

Data:

LOAD date, sender, SubField(recipient, ';') AS recipient, server, subject;

LOAD * INLINE [

date, sender, recipient, server, subject

01/05/2016, usr1@pp.com, usr2@pp.com;usr3@pp.com;usr4@pp.com, host1, xxx

];

Also refer the application file attached herewith.

Regards!

Rahul

MK_QSL
MVP
MVP

Subfield(recipient,';') as recipient

dcd123456
Creator
Creator
Author

it works fine, thanks for your quickly answer.

best regards

dcd

dcd123456
Creator
Creator
Author

It Works fine

Thanks very much for your Answer

Best Regards

dcd