company logo

Property :: statistic - Calculate statistic values for a collection

The function returns the statistic values (x0:count, x1:sum, x2:square sum) for an attribute/expression for a collection. In case of an error, the function throws an exception.

Return value:  Value ( odaba::Value & )

Value of any type.

Implementation details

odaba::Value Property  :: statistic ( odaba::String &sName )

The function calculates statistic values for the attribute path or expression passed in sExpression over all instances in the collection. When a filter condition has been set, only instances filtered by condition are considered. The value returned is a statistic object ( SDB_Statistic ).

The expression passed must be a valid numeric property or expression in the context of the instances to be aggregated.

Notes:

In general, using the statistic function and calculating statistical values at the end may improve performance compared with using sum, average, deviation etc.

  • sName - Name