You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.
SUM
Adds the values of a collection of numbers.
Syntax
SUM ( collection )
Inputs
collection - A collection of number values.
Return types
number
integer
currency
percentage
Examples
Suppose the following data model.
Person.name | Person.gender | Person.age |
---|---|---|
“Kim” | “f” | 23 |
“Rick” | “m” | 35 |
“Bob” | “m” | 42 |
“John” | “m” | 19 |
“Mary” | “f” | 33 |
Expression | Result | Type |
---|---|---|
SUM ( COLLECT Person.age FROM ALL Person ) | 152 | Integer |
SUM ( COLLECT Person.age FROM ALL Person WHERE ( Person.gender = "m" ) ) | 96 | Integer |
SUM ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ) | 55 | Integer |
Overview
Content Tools