# SUM function

## `SUM` function

| Function Name | Description | Usage | Input parameter | Return value |
|---|---|---|---|---|
| `SUM` | Adds all the values in an array. | `SUM()` | N/A | Sum of all the numbers in an array. The return type depends on the type of the array. For example, for an array of type `Double`, the return type is a double value. |

## Supported data type


The `SUM` function supports the following data types:

- Double array
- Integer array

## Example: Add all the values of an integer array


**Sample data** : `$var1$ = {5,8,2,1}`


**Usage** : `$var1$.SUM()`
Add all the values in var1.


**Output** : `16`

## Recommendation

- Learn how to add and configure a [Data Mapping task](https://docs-0cloud-0google-0com.linkedin.net.nz/application-integration/docs/configure-data-mapping-task.md.txt)