Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I concatenate a list of values to an associated set of data? Whilst retaining the original values
For example
Table 1
Meeting notes | Meeting ID |
---|---|
gdggdfgdfsgdfgdfgdfggdfgdfg | 12 |
dfgdfgfnhkuykjndfdv | 13 |
dgwgrenfgjtyikir | 14 |
Table 2
Meeting ID | Attendee |
---|---|
12 | Bob |
12 | Jack |
13 | Sam |
13 | Alex |
13 | Jane |
14 | Bob |
14 | Alex |
I need the list of attendees concatenated as per the 3rd column. I still need to retain table 1 and table 2 separately though.
Is it best to concatenate it on the front end? Or is it best to do it in the load
Meeting notes | Meeting ID | Attendees |
---|---|---|
gdggdfgdfsgdfgdfgdfggdfgdfg | 12 | Bob, Jack |
dfgdfgfnhkuykjndfdv | 13 | Sam, Alex, Jane |
dgwgrenfgjtyikir | 14 | Bob, Alex |
It was as simple as adding another expression
concat(distinct Attendee,',')
Hi Alex, try this:
Table1:
LOAD [Meeting notes], [Meeting ID] from...;
Left Join (Table1)
LOAD [Meeting ID], Concat(Attendee, ', ') as Attendees from .... Group by [Meeting ID]
It was as simple as adding another expression
concat(distinct Attendee,',')