Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
patbuchanan
Contributor III
Contributor III

How do I Group Text Values Together from Multiple Records

I have a table that has multiple records for and ID based on how many Rooms are associated to that ID and I'm trying to present one record for each ID that has all the Rooms associated with the ID combined in one field.

So, I'm trying to convert:

Rows.JPG.jpg

To:

Columns.JPG.jpg

1 Solution

Accepted Solutions
simenkg
Specialist
Specialist

Depends on where you want to do this.

In script:

Load ID, Concat(distinct Room,',') as [Room(s)]
From Table.qvd (qvd)
group by ID;

In chart.

Dimension: ID
Expression: Concat(distinct Room,',')

Regards

SKG

View solution in original post

6 Replies
simenkg
Specialist
Specialist

Depends on where you want to do this.

In script:

Load ID, Concat(distinct Room,',') as [Room(s)]
From Table.qvd (qvd)
group by ID;

In chart.

Dimension: ID
Expression: Concat(distinct Room,',')

Regards

SKG

maxgro
MVP
MVP

load ID, concat(Room, ', ') as Rooms

from yoursourcetable

group by ID;

JonnyPoole
Employee
Employee

Worth putting a 'distinct' in there so it doesn't repeat values (if that is a possibility)

Concat( distinct  Room,',')

simenkg
Specialist
Specialist

I agree. I will edit my response.

ashfaq_haseeb
Champion III
Champion III

Try this

Load ID,Concat(Room,',') as Rooms Group by ID;

Load * Inline

[

ID,Room

100,Room1

100,Room3

101,Room1

101,Room2

];

Regards

ASHFAQ

Not applicable

HI Pat hope you help this

Try this both

In script:

Load ID, Concat(distinct Room,',') as [Room(s)]
From Table.qvd (qvd)
group by ID;

or

Load ID,Concat(Room,',') as Rooms Group by ID;

Load * Inline

[

ID,Room

100,Room1

100,Room3

101,Room1

101,Room2

];