The Sum()
function calculates the total value of a list of numbers or durations.
Syntax
Sum(values)
Returns
A number or duration that is the total value of the given values
.
Parameters
values
– the list of values of which the sum is calculated. The values can be either numbers or durations.
Examples
Sum([ShoppingCart.Price] * [ShoppingCart.Amount] of [ShoppingCart])
/* returns the total price of all items in the shopping cart */
Sum([Appointments.Duration] of [Appointments])
/* returns total duration of all appointments */
Sum(List(1, 3, 6, 2))
/* returns 12 */