Concatenating rows in a table

I am looking for a way to concatenate a group of string which all appear in the same column, however in different rows.

ex.

  1. bob
  2. joe
  3. harry
  4. tom

Would concatenate to bob, joe, harry, tom

Is this possible?

0 4 4,286
4 REPLIES 4

er1k
Participant V

If your database supports LISTAGG() then you can use LISTAGG(name,’, ') to get list of names separated by comma.

More here: https://looker.com/blog/how-to-use-listagg-distinct-amazon-redshift-looker

The type: list measure (docs here) is meant for this purpose.

@Brett_Sauve is there a way to change the order by clause of the listagg ?
a general syntax or listagg would be 
LISTAGG( [ DISTINCT ] <expr1> [, <delimiter> ] ) [ WITHIN GROUP ( <orderby_clause> ) ]
How can we have multiple objects in the order by clause ?
ex: listagg(distinct hire_date, ‘, ’) within group (order by emp_id, dept_id)

Hi, Everyone, I am a new Looker user (I am using Looker studio Free version)
I would like to ask a question, may someone tell me if possible to Concat two rows in Looker studio?
case on the first-row day plan id = the third-row day plan id then Concat Start date from the first-row with the Start date on the third-row. Screenshot 2023-09-20 192614.png

Top Labels in this Space
Top Solution Authors