Operator Scope of Action:
Operator First Added:
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.
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.
$MyNumber = avg_if(children(/Catalog),$Price!=0,$Price);
sets $MyNumber to the average price of all the items in Catalog, ignoring any items that have a price of 0.