Tinderbox v10 Icon

avg(scope, expressionStr)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Data Type Returned: 

Operator First Added: 

Operator in Current Baseline: 

Operator Last Altered: 

Operator Uses Scoped Arguments: 

Operator Has Newer Dot-Operator Variant: 

 Function  [other Function type actions]

 Group  [operators of similar scope]

 Mathematical  [other Mathematical operators]

 Number [about Number data type]

 v4.6.0

 Baseline

 As at baseline

 [More on scoped arguments in Action Code]

Yes


avg(scope, expressionStr)

This computes the arithmetic mean of the value of a expressionStr in a scope. See avg_if() for a for a related conditional operator.

scope describes the notes to be examined and may be any group designator including a find() query.

expressionStr may be any valid expression, but will usually be a reference to an attribute; short form Boolean attribute expressions are acceptable.

For example:

$MyNumber = avg(children(/Catalog),$Price); 

returns the average price of all the items in Catalog.


See also—notes linking to here: