Built-in Functions → sum

sum() is an aggregation function that returns the sum of the values in a column.

Signature

```sum(double[] exp)
```

double[] exp : expression evaluating to `double`

Returns

`double` representing the sum of the values in the column.

Example

Consider the following table of example data:

```Year    Quarter    Month    Amount Sold
2019    Q1         M1       1002019    Q1         M2       2002019    Q1         M3       1002019    Q2         M4       1502019    Q2         M5       2502019    Q2         M6       1502019    Q3         M7       2002019    Q3         M8       250 2019    Q3         M9       300 2019    Q4         M10      100 2019    Q4         M11      50 2019    Q4         M12      502020    Q1         M1       1502020    Q1         M2       1002020    Q1         M3       2002020    Q2         M4       1502020    Q2         M5       1002020    Q2         M6       1502020    Q3         M7       502020    Q3         M8       100 2020    Q3         M9       200 2020    Q4         M10      150 2020    Q4         M11      100 2020    Q4         M12      50
```

Find the total amount sold (add up the values in the Amount Sold column).

```sum(AMOUNT_SOLD)
```