GLOBAL
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 the 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 takes 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 )
aggregation: The aggregation function including its parameters to use. Can be one of:
NULL handling
If the input value is NULL, then GLOBAL returns NULL as well.
Note
The result of GLOBAL cannot be used as a grouper column for an aggregation.
Like the standard aggregation functions, GLOBAL cannot be used inside a FILTER statement.
Use Cases
GLOBAL
can be used for Rework per Activity.
Examples
[1] Calculating the sum for two groups and the count for one group | ||||||||||||||||||||
| ||||||||||||||||||||
|
[2] Calculating the sum for two groups and the count for one group as a result of a filter | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
|
[3] For each row, return 1 if the value is greater than the global average value (5) of that column: | ||||||||||||||||||||||||
| ||||||||||||||||||||||||
|