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: 
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