Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
She1
Former Employee
Former Employee

Implementing text to column feature in Qlik Sense

Hi,

I want the text values in  a comma separated text field to be split into multiple fields with one value each .The field is as shown below. I want the values in separate columns.

She1_0-1657162999371.png

 

Labels (1)
1 Solution

Accepted Solutions
sidhiq91
Specialist II
Specialist II

@She1  Please use the below script, to get the desired output.

NoConcatenate
Text:
Load * Inline [
Text
Microsoft Google IBM SalesForce Alteryx aws gcp RPA
];


NoConcatenate
Text1:
Load *,
SubField(Text,' ',1) as Text1,
SubField(Text,' ',2) as Text2,
SubField(Text,' ',3) as Text3,
SubField(Text,' ',4) as Text4,
SubField(Text,' ',5) as Text5,
SubField(Text,' ',6) as Text6,
SubField(Text,' ',7) as Text7,
SubField(Text,' ',8) as Text8
Resident Text;

Drop table Text;

Exit Script;

If this resolves your issue please like and accept it as a solution.

View solution in original post

6 Replies
Lisa_P
Employee
Employee

The Subfield function can do that either in the load script or in the chart itself ..

See instructions in Qlik help ..

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunction... 

sidhiq91
Specialist II
Specialist II

@She1  Please use the below script, to get the desired output.

NoConcatenate
Text:
Load * Inline [
Text
Microsoft Google IBM SalesForce Alteryx aws gcp RPA
];


NoConcatenate
Text1:
Load *,
SubField(Text,' ',1) as Text1,
SubField(Text,' ',2) as Text2,
SubField(Text,' ',3) as Text3,
SubField(Text,' ',4) as Text4,
SubField(Text,' ',5) as Text5,
SubField(Text,' ',6) as Text6,
SubField(Text,' ',7) as Text7,
SubField(Text,' ',8) as Text8
Resident Text;

Drop table Text;

Exit Script;

If this resolves your issue please like and accept it as a solution.

She1
Former Employee
Former Employee
Author

Thanks Lisa! My issue will get resolved with this function!

She1
Former Employee
Former Employee
Author

Thank you so much! Subfield suffices my purpose! 

Sloane
Contributor II
Contributor II

is there a way to achieve this split (to columns and not rows) without writing out as many Subfield commands?

Lisa_P
Employee
Employee

If they are all comma separated, all you need to do is :

SubField(Text, ',') as Partners

This should separate them all out