GROUPCONCAT

Syntax

GROUPCONCAT(<any>; [<any>])

Description

Creates a list of all non-null values seen in a group (currently, max. 1000 values are collected). The order of elements isn't stable when running on a cluster, because the elements for each group might be collected on different nodes. If the element order matters, provide an order by expression as a second (optional) argument. This could, for example, be a timestamp or ID column in your data set.

This is an aggregate function. 

Example

Given the following data:

KeyValueTime_Stamp
group1a1
group1b4
group1c3
group1d2
group2a4
group2b3
group2c2
group2d1

First, create a group, e.g. GROUPBY(#RawData!Key)

Groups
group1
group2

Then use the GROUPCONCAT(#RawData!Value;#RawData!Time_Stamp), and the result is a list ordered by the identifier in relation to the GROUPBY() column.

GroupsValue
group1[a, d, c, b]
group2[d, c, b, a]

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