Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Applies to:  
Status
colourGreen
titleCelonis 4.0
 
Status
colourGreen
titleCelonis 4.2
 
Status
colourGreen
titleCelonis 4.3
 
Status
colourGreen
titleCelonis 4.4
 
Status
colourGreen
titleCelonis 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

Code Block
languagetext
themeDJango
GLOBAL ( aggregation )

Note

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

Examples


Panel
borderColorgrey
Section
Calculating the sum for two groups and the count for one group

Section
Panel
titleQuery
Column1
Code Block
languagetext
themeDJango
"Table1"."Dim1"
Column2
Code Block
languagetext
themeDJango
SUM ( "Table1"."Column1" ) / GLOBAL ( COUNT_TABLE ( "Table1" ) )
Section
Column
width50%
Panel
titleInput
Table1
Dim1 : STRINGColumn1 : FLOAT
'A'
1.0
'B'
1.0
'A'
1.0
'B'
1.0
Column
width50%
Panel
titleOutput
Result
Column1 : STRINGColumn2 : FLOAT
'A'
0.5
'B'
0.5



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

Section
Panel
titleQuery
Filter
Code Block
languagetext
themeDJango
FILTER "Table1"."Dim1" != 'C' 
Column1
Code Block
languagetext
themeDJango
"Table1"."Dim1"
Column2
Code Block
languagetext
themeDJango
SUM ( "Table1"."Column1" ) / GLOBAL ( COUNT ( "Table1"."Column1") )
Section
Column
width50%
Panel
titleInput
Table1
Dim1 : STRINGColumn1 : FLOAT
'A'
1.0
'B'
1.0
'C'
1.0
'A'
1.0
'B'
1.0
'C'
1.0
Column
width50%
Panel
titleOutput
Result
Column1 : STRINGColumn2 : FLOAT
'A'
0.5
'B'
0.5