Applies to: CELONIS 4.0 CELONIS 4.2 CELONIS 4.3 CELONIS 4.4
Description
This function calculates the median per group. Median can be applied to INT, FLOAT or DATE columns.
The median is the middle element of a group. If the group has an even number of elements, the upper value of the two middle values is taken as the median.
Syntax
MEDIAN ( table.column )
Null handling
Null values are ignored, meaning that they don't influence the result. If all values of a group are null, the result for this group is also null.
Examples
Median of column with 3 rows.
Query
Column1
MEDIAN ( "Table"."Column" )
Median of column with 4 rows. If a group has an even number of entries, the upper value of the two middle values is taken.
Query
Column1
MEDIAN ( "Table"."Column" )
Get the median value by country.
Query
Column1
"Table"."Country"
Column2
MEDIAN ( "Table"."Values" )
Get the median value mixed with nulls, grouped by country.
Query
Column1
"Table"."Country"
Column2
MEDIAN ( "Table"."Values" )