Basic Syntax CrystalClear Syntax Before Reading Records

Average( fld )
Average( fld, condFld )
Average( fld, condFld, cond )
Average( array )


Returns the average value of a field or an array.
You can also provide a field to group the values of the field (fld).

Usage:

Average( fld )
Average( fld, condFld )
Average( fld, condFld, cond )
Average( array )

Parameters:

fld The name of a field whose values should be used to calculate the average value.
condFld The name of the field that groups the values of fld (if fld isn't an array).
cond A string declaring the type of grouping to be used on condFld. This only makes sense for groups based on Date, DateTime, Time, and Boolean fields. See Summary Field Conditions for a list of strings you can use here.
array The name of an array variable whose values should be used to calculate the average value.

Returns:

A number.

Examples:

//computes the average of the values of a field "production" of table "factory"
average({factory.production})
//computes the average of the array values
average([1,2,3,4,5,6]) //returns 3.5
//computes the average of the return value (has to be an array) of the formula field "makeArray"
average({@makeArray})
//computes the average of the sales amount of all vendors grouped by vendor
average({Sales.Sale_Amount},{Vendors.VendorID})

Notes:

See also:


i-net software strives to provide accurate product documentation. Please give us your feedback using the form below.
NOTE: This form is for documentation feedback only. For technical assistance, please send an email to crystalclear@inetsoftware.de.

This page is: very poor very good
Comment: