PU_STRING_AGG
Applies to: CELONIS 4.7
Description
The PU_STRING_AGG operator returns the concatenation of strings from the given parent column. The delimiter will be always inserted between the concatenation of the strings. Multiple order by
expressions can be used in order to determine the order of the concatenation.
The PU_STRING_AGG function can only be applied to STRINGs.
Syntax
PU_STRING_AGG ( child, parent.column, delimiter [, filter_expression ] [, ORDER BY parent_table.column [ASC|DESC] ] )
child_table: The table to which the aggregation result should be pulled. This can be:
a table from the data model. This table needs to be a child table of the parent_table. Documentation about parent and child tables can be found in Join functionality.
parent_table.column: The column which should be aggregated for every row of the child_table.
delimiter: A delimiter STRING what should be used to separate the strings in the result.
filter_expression (optional): An optional filter expression to specify which values of the parent_table.column should be taken into account for the aggregation.
ORDER BY (optional): Elements of the specified column are used to determine the order in which the strings should be concatenated in the result. After the column, ASC (for ascending direction) or DESC (descending direction) can be specified. If the order direction is not specified, the ascending (ASC) order is used.
NULL handling
If no value in the parent table exists for the element in the child table (either because all values of the parent table are filtered out, or because no corresponding value exists in the first place), NULL will be returned. NULL values in the parent table column are treated as if the row does not exist.
Examples
[1] Aggregate the activity column per case.
|
[2] Aggregate the activity column per casewith respect to the ascending sorted order of value 2 and the descending sorted order of value 1.
|
[3] Aggregate the activity column per case with respect to the ascending sorted order of value while only the activities which have a value between 10 and 30 are concatenated.
|
[4] Aggregate the activities per case where
|
[5] One can use the INDEX_ORDER to aggregate only distinct values. The example below calculates the distinct currencies involved in each case.
|