You are viewing the documentation for Blueriq 15. 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.namePerson.genderPerson.age
“Kim”“f”23
“Rick”“m”35
“Bob”“m”42
“John”“m”19
“Mary”“f”33
ExpressionResultType
SUM ( COLLECT Person.age FROM ALL Person )152Integer
SUM ( COLLECT Person.age FROM ALL Person WHERE ( Person.gender = "m" ) )96Integer
SUM ( [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] )55Integer