Page tree
Skip to end of metadata
Go to start of metadata

Syntax

GROUPCONCATDISTINCT(<any>[; <number>])

Description

Concatenates all non-null values seen in a group. The first argument is the column containing values that should be concatenated. The second value is an optional constant used to set a maximum number of values to avoid overflow problems with very large groups. The maximum number of values defaults to 1000. If more than the configured maximum number n of values are seen, the top n values in ascending order are kept.
The concatenated values are returned as a list

This is an aggregate function

Example

Given the following data:

GroupsItems
group12
group15
group1<null>
group117
group18
group2<null>
group26
group26
group25
group212
group3<null>
group3<null>
group322
group325
group312

First create a group using GROUPBY(#RawData!Groups)

Groups
group1
group2
group3


Then use the GROUPCONCATDISTINCT(#RawData!Items;2) and the result is the non-null values concatenated in the number of groups you specified by the constant. 

GroupsItem_CONCAT
group1[2, 5]
group2[5, 6]
group3[12, 22]

 This function returns a list. If you require a JSON represented as a string, wrap this function in TOJSON (E.g., TOJSON(<function>(...)).

  • No labels