Applies to:  CELONIS 4.0 CELONIS 4.2 CELONIS 4.3 CELONIS 4.4 CELONIS 4.5 

Description

In general, only one aggregation is calculated for a query. With a global aggregation it is possible to calculate an additional aggregation function over all values of a column.

GLOBAL calculates an aggregation function for an aggregation to which all values are aggregated into one group.

Like normal aggregations, a global aggregation function take filters and selections into account. Values which are filtered out are not part of the result. Therefore if a filter or a selection is changed every global aggregation function is recalculated.

Syntax

GLOBAL ( aggregation )

Note

The result of GLOBAL can not be used as a grouper column for an aggregation.

Examples


Calculating the sum for two groups and the count for one group

Query
Column1
"Table1"."Dim1"
Column2
SUM ( "Table1"."Column1" ) / GLOBAL ( COUNT_TABLE ( "Table1" ) )
Input
Table1
Dim1 : STRINGColumn1 : FLOAT
'A'
1.0
'B'
1.0
'A'
1.0
'B'
1.0
Output
Result
Column1 : STRINGColumn2 : FLOAT
'A'
0.5
'B'
0.5



Calculating the sum for two groups and the count for one group as a result of a filter

Query
Filter
FILTER "Table1"."Dim1" != 'C' 
Column1
"Table1"."Dim1"
Column2
SUM ( "Table1"."Column1" ) / GLOBAL ( COUNT ( "Table1"."Column1") )
Input
Table1
Dim1 : STRINGColumn1 : FLOAT
'A'
1.0
'B'
1.0
'C'
1.0
'A'
1.0
'B'
1.0
'C'
1.0
Output
Result
Column1 : STRINGColumn2 : FLOAT
'A'
0.5
'B'
0.5


  • No labels