Pages

Monday 18 April 2011

OBIEE - AVG

Avg

Calculates the average (mean) value of an expression in a result set. Must take a numeric expression as its argument.

The AVG is calculated as the sum of all rows aggregated divided by the number of rows aggregated. If the function is pushed down to the database, rows with nulls are excluded from the calculation by default. If AVG is done in Answers, then Nulls will cause errors in AVG.

Syntax

Avg(numExpr)

Where:
numExpr - Any expression that evaluates to a numerical value.

AvgDistinct

This function calculates the average (mean) of all distinct values of an expression. It must take a numeric expression as its argument.

Syntax

AVG(DISTINCT numExpr)

Where:
numExpr - is any expression that evaluates to a numeric value.