---
title: average() | Tiger Data Docs
description: Calculate the average from a one-dimensional statistical aggregate
---

Since [1.3.0](https://github.com/timescale/timescaledb-toolkit/releases/tag/1.3.0)

Calculate a simple average (or mean) from the values in a statistical aggregate.

## Samples

Calculate the average of the integers from 0 to 100:

```
SELECT average(stats_agg(data))
  FROM generate_series(0, 100) data;
```

```
average
-----------
50
```

## Arguments

The syntax is:

```
average(
  summary StatsSummary1D
) RETURNS DOUBLE PRECISION
```

| Name    | Type           | Default | Required | Description                                              |
| ------- | -------------- | ------- | -------- | -------------------------------------------------------- |
| summary | StatsSummary1D | -       | ✔        | The statistical aggregate produced by a `stats_agg` call |

## Returns

| Column  | Type             | Description                                            |
| ------- | ---------------- | ------------------------------------------------------ |
| average | DOUBLE PRECISION | The average of the values in the statistical aggregate |
