
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Concat/Group All Field Values by Value
Hello Folks,
I'm working with the following problem, below is the table that I'm starting with.
DummyTable:
Load * Inline
[
PersonId, Course
1 , Physics
1 , Chemistry
2 , Fingerpainting
2 , Transmission Maintenance
2 , Alchemy
3 , Magic Tricks
3 , Traffic Guarding 101
]
;
I'm trying to get a table that looks like this, where I CONCAT all the Courses based on their PersonId:
PersonId | CourseList |
1 | Physics, Chemistry |
2 | Fingerpainting, Transmission Maintenance, Alchemy |
3 | Magic Tricks, Traffic Guarding 101 |
I'm completely unsure about how to go about this, even though I swear I've done it in the past.
Any help is greatly appreciated.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like this
NoConcatenate
load PersonId,
concat(distinct Course,', ') as Course
Resident DummyTable
group by PersonId;
drop table DummyTable;
exit script;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here you go -
DummyTable:
Load * Inline
[
PersonId, Course
1 , Physics
1 , Chemistry
2 , Fingerpainting
2 , Transmission Maintenance
2 , Alchemy
3 , Magic Tricks
3 , Traffic Guarding 101
]
;
Noconcatenate
Final:
Load PersonId, Concat(Course,',') as CourseList
resident DummyTable
Group By PersonId
;
Drop table DummyTable;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be directly in the visual -

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like this
NoConcatenate
load PersonId,
concat(distinct Course,', ') as Course
Resident DummyTable
group by PersonId;
drop table DummyTable;
exit script;
