Skip to main content



Sum Function

Returns the sum of a specified member or expression across a collection.

Syntax 1

Sum(collection, field)

Returns the sum of a specified member or expression across a collection.

Arguments

collection Collection - A collection.

field Field - The field to sum.

Syntax 2

Sum(collection, expression)

Returns the sum of a specified member or expression across a collection.

Arguments

collection Collection - A collection.

expression Numeric - An expression that resolves to a number.

Syntax 3

Sum(collection, field, filter)

Returns the sum of a specified member or expression across a collection.

Arguments

collection Collection - A collection.

field Field - The field to sum.

filter FilterExpression - Filter criteria. Only collection members that match this criteria will be considered.

Syntax 4

Sum(collection, expression, filter)

Returns the sum of a specified member or expression across a collection.

Arguments

collection Collection - A collection.

expression Numeric - An expression that resolves to a number.

filter FilterExpression - Filter criteria. Only collection members that match this criteria will be considered.

Remarks

  • Arguments after the collection argument are evaluated in the context of a collection member.

Example:

Sum(Vehicles, BI_PD.Premium, Year=1999); // returns 400540