The TOTAL function will add the values of a given object property together for all instances of the object in a specified collection property. Optional criteria may be specified to include only specific objects within the collection being processed.
This function takes three parameters. The first is the object collection property, and the second is the object property whose value is to be summed in each object instance. An optional third parameter can be provided to include only certain object instances within the collection in this operation. This function supports the integral number and decimal number return types.
The object property values are totalled by the function based on the function’s context, not the data type of the object property definition. This is important to note when the context is in an integral number, and the properties to be totaled are decimals. In this situation, the fractional portion of the properties will be truncated from the values prior to being added together.
@TOTAL (Object Collection, [Child Property [, Include Criteria]]) | |
---|---|
Object Collection | Required object collection property parameter; contains the
object instances whose property values will be totaled by the function. |
Child Property | Optional property parameter; specifies the object property to
be totaled in each object instance in Object Collection.
These property values will be evaluated as the data type of the
function’s context, which may be either integral number or decimal
number. |
Include Criteria | Optional Boolean parameter; this term is evaluated once for,
and in the context of each object instance in Object Collection.
The function will process each object instance for which this term
returns true, and exclude those for which it returns false. If this parameter
is not provided, all object instances will be processed by the function. |