Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
dmohanty
Partner - Specialist
Partner - Specialist

Convert Multiple Rows into Single using a Separator?

Hi All,

I have a data set like this below example:

 

IDCountryGroupStuff
100USAFootwearBoots
100USAFootwearSandals
100USAFootwearBellies
100USAFootwearCanvas
200CANCerealsRice
200CANCerealsWheat
200CANCerealsMaize

I need this to be converted into like this -

 

IDCountryGroupStuff
100USAFootwearBoots,Sandals,Bellies,Canvas
200CANCerealsRice,Wheat,Maize

Could someone please help here?

Regards!

1 Solution

Accepted Solutions
marcus_sommer

This could be done per concat:

Load ID, Country, Group, concat(Stuff, ', ') as Stuff From xyz Group by ID, Country, Group;

- Marcus

View solution in original post

4 Replies
marcus_sommer

This could be done per concat:

Load ID, Country, Group, concat(Stuff, ', ') as Stuff From xyz Group by ID, Country, Group;

- Marcus

maxgro
MVP
MVP

LOAD ID,

    Country,

    Group,

    concat(Stuff, ',') as Stuff

FROM

[https://community.qlik.com/thread/173967]

(html, codepage is 1252, embedded labels, table is @1)

group by ID,      Country,      Group;

1.png

sunny_talwar

Try this:

Table:

LOAD ID,

    Country,

    Group,

    Stuff

FROM

[https://community.qlik.com/thread/173967]

(html, codepage is 1252, embedded labels, table is @1);

Join(Table)

LOAD ID,

  Country,

  Group,

  Concat(Stuff, ', ') as ConcatStuff

Resident Table

Group By ID, Country, Group;


Capture.PNG

dmohanty
Partner - Specialist
Partner - Specialist
Author

Hey Thank you Marcus, Massimo and Sunny.

This helped. Thanks again for guidance.