- Introduction to WorkXpress
- Building Your Application
- Examples and Best Practices
- Technical Manual

This shows you the differences between two versions of the page.

— |
expression function - sum [2016/09/14 14:19] (current) |
||
---|---|---|---|

Line 1: | Line 1: | ||

+ | ====== Sum (Expression Function) ====== | ||

+ | ===== Purpose ===== | ||

+ | The **Sum** function (SUM) is used to sum all the numbers together from multiple field values. | ||

+ | |||

+ | {{::sum_initial.png?direct&600|}} | ||

+ | ===== Parameters ===== | ||

+ | The **Sum** function has one parameters: | ||

+ | |||

+ | ==== Field Value ==== | ||

+ | |||

+ | Allowed Inputs: [[Field|field]] values | ||

+ | |||

+ | The parameter of the **Sum** function is the field values that contains the numbers that will be summed together. The input is a query built using the [[Query Builder]] to find [[Field|field]] values on one or many [[record|record(s)]] in a [[Table|table]]. | ||

+ | |||

+ | ===== Output ===== | ||

+ | |||

+ | The output of the **Sum** function is a number representing a sum of all the values found. | ||

+ | |||

+ | ===== Example ===== | ||

+ | |||

+ | If an Invoice record has 4 related Line Item records, and those records have values of -6, 0, 8, and 24 in the Quantity field, SUM(${Line Item ~> Quantity}) would result in 26 (since -6 + 0 + 8 + 24 = 26). |

Copyright WorkXpress, 2019