contents.gifindex.gifprev1.gifnext1.gif

Collection_Total

Purpose

Returns a single value aggregating one of the attributes in the collection.

Arguments

Collection_Total( <coll>, <aggregate spec> )

Example

Collection_Total(

Collection_Group(

Collection_Create(

"", "FB_LN" , "SELF![CAT]='FREIGHT'"

, "[CMDTY_CLASS]

[Quantity:CLng(ConvertNulls(SELF![QTY_LABL],0))]

[Line:SELF![LINE_ITEM_NUM]]"

)

, "[Group][Sum][Line:Count]"

) // Defines <coll>.

, "Quantity:Sum" // Sum over the attribute Quantity.

)

Notes

<aggregate spec> has the form [<attribute name>:<aggregate function>].

The functions are:

Sum
Totals the values.
Count
Counts the number of rows.
List
Build a list of the values.
Av
Averages the values, excluding nulls.
Min
Use the minimum value.
Max
Use the maximum value.
Cat
Concatenate string values in order of occurrence.