# sum

> Documentation index: http://docs.tenzir.com/llms.txt

Computes the sum of all values.

```tql
sum(xs:list) -> int
```

## Description

The `sum` function computes the total of all number values.

### `xs: list`

The values to aggregate.

## Examples

### Compute a sum over a group of events

```tql
from {x: 1}, {x: 2}, {x: 3}
summarize n=sum(x)
```

```tql
{n: 6}
```

## See Also

* [`collect`](http://docs.tenzir.com/reference/functions/collect.md)
* [`max`](http://docs.tenzir.com/reference/functions/max.md)
* [`mean`](http://docs.tenzir.com/reference/functions/mean.md)
* [`min`](http://docs.tenzir.com/reference/functions/min.md)
* [Aggregate event streams](http://docs.tenzir.com/guides/analytics/aggregate-event-streams.md)
* [Plot data with charts](http://docs.tenzir.com/tutorials/plot-data-with-charts.md)
* [Learn idiomatic TQL](http://docs.tenzir.com/tutorials/learn-idiomatic-tql.md)