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

Combining multiple rows into one row separated by commas

Hi,

I have a table where I need to convert the rows into one field. The values shall be separated by a comma.

Eg.

LOAD * INLINE [
Cause
Missing value
Missing signature
Dataformat not correct
];

The end result should be a field called Causes and the value should be Missing value, Missing signature, Dataformat not correct.

I have tried looping through the values using a variable and just adding values to the same field in the load script. I just can't figure this one out.

I hope someone can help me.

BR

Michael

Best regards
Michael Vaisgaard
1 Solution

Accepted Solutions
martinpohl
Partner - Master
Partner - Master

load 

concat(Cause,', ') as Causecombine

resident yourdata;

Regards

View solution in original post

4 Replies
martinpohl
Partner - Master
Partner - Master

load 

concat(Cause,', ') as Causecombine

resident yourdata;

Regards

JGMDataAnalysis
Creator III
Creator III

Something like this?

Test:
NOCONCATENATE
LOAD Concat(Cause, ', ', Sort) AS Causes
INLINE [
        Cause, Sort
        Missing value, 1
        Missing signature, 2
        Dataformat not correct, 3
];

 

clipboard_image_0.png

vaisgaard
Contributor III
Contributor III
Author

Thank you so much Martin.

Best regards
Michael Vaisgaard
vaisgaard
Contributor III
Contributor III
Author

Thank you for replying 🙂

Best regards
Michael Vaisgaard