I am looking for a way to concatenate a group of string which all appear in the same column, however in different rows.
ex.
- bob
- joe
- harry
- tom
Would concatenate to bob, joe, harry, tom
Is this possible?
I am looking for a way to concatenate a group of string which all appear in the same column, however in different rows.
ex.
Would concatenate to bob, joe, harry, tom
Is this possible?
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.
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)
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.