Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
selvakumara
Creator
Creator

Comma separate multiple columns into multiple rows

Team,

I have multiple comma separated columns in SQL . I want to convert those columns into multiple rows. How can I achieve that in Qlik sense?

I have a separate lookup table to map those values. all I need to do is split and join with lookup table

 

Thanks,

Selva.

Labels (6)
1 Reply
maxgro
MVP
MVP

Maybe with the subfield function

 

// My test data; edit this part of the script to fit your table

T2:
load * inline [
F1| F2
1,2,3|1,2,3,4,5
10,20,30|100,200,0,0,0,0,0,1000
]
(delimiter is |);

maxgro_0-1654017401235.png

 

// from columns to rows

T3:
LOAD
SUBFIELD(F1, ',') as C1
RESIDENT T2;

CONCATENATE (T3)
LOAD
SUBFIELD(F2, ',') as C2
RESIDENT T2;

maxgro_1-1654017442385.png