avg_if(group,condition,value)

Tinderbox Icon


Operator Type:   Function
Operator Scope of Action:   Conditional Group
Operator Purpose:   Mathematical

avg_if(group,condition,value)

This computes the arithmetic mean of a value in a group, as filtered by a condition expression. See avg() for a for a related non-conditional operator.

group describes the notes to be examined and may be any of {children,descendants,siblings,ancestors,all}.

condition is a valid conditional test - i.e. it equates to true when matched.

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

For example:

avg_if(children(/Catalog),$Price!=0,$Price) 

returns the average price of all the items in Catalog, ignoring any items that have a price of 0.


Possible relevant notes (via "Similar Notes" feature):

Up: Full Operator List
Previous: avg(group,value)  Next: between(value,min,max) 

A Tinderbox Reference File : Actions & Rules : Operators : Full Operator List : avg_if(group,condition,value)

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox