Average

Average(DBField a)

The function is used to get the average value of the values referred to by the argument.

Parameter

a - Values of DBField or formula field. Can be Number or Currency data type.

Return value

The return value can be Number or Currency.

Examples

Average(DBField a, String groupby)

This function is used to get the average value of values referred to by the argument.

Parameters

Return value

The result value can be Number or Currency, and is depent on the data type of the first argument respectively.

Examples

Average(Number a[])

This function computes the average of all the values in the array.

Parameter

a - A Number or Currency array.

Return value

The return value is a Number or a Currency.

Examples

Note: If a field is assigned to a variable, for example x, the variable x will lose the characteristic of representing a group of values. The following formula will then be treated as incorrect.

Number x = @dbfield;
Number y = Average(x); // system will prompt you that there is no such kind of function.