AVG
Syntax
<avg-expression> := 'AVG(' <Number>, { ',' <Number> } ')'
Since
1.0
Return-type
Double
Description
The function AVG returns the average value of all values of all arguments.
If the argument contains NULL-values, these will be ignored! If you don't want to ignore NULL-values, you can use the ZERO-function to interpret them as zero. If only NULL-values are passed as argument, the function returns NULL.
Examples
AVG( 2, 4 )
= 3
AVG( Amount( LEVEL( Time, 3 ) )
Average amount of all days (level 3 of time-dimension)
AVG( ZERO( Amount( LEVEL( Time, 3 ) ) )
Average amount of all days (level 3 of time-dimension), interpreting NULL as 0
AVG( NULL )
= NULL
See also
ALL, COUNT, MAX, MIN, ZERO
