---
title: rolling() | Tiger Data Docs
description: Combine multiple two-dimensional statistical aggregates to calculate rolling window aggregates
---

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

Combine multiple intermediate two-dimensional statistical aggregate (`StatsSummary2D`) objects into a single `StatsSummary2D` object. It is optimized for use in a window function context for computing tumbling window statistical aggregates.

This is especially useful for computing tumbling window aggregates from a continuous aggregate. It can be orders of magnitude faster because it uses inverse transition and combine functions, with the possibility that bigger floating point errors can occur in unusual scenarios.

For re-aggregation in a non-window function context, such as combining hourly buckets into daily buckets, see `rollup()`.

## Arguments

The syntax is:

```
rolling(
    ss StatsSummary2D
) RETURNS StatsSummary2D
```

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

## Returns

| Column  | Type           | Description                                                                        |
| ------- | -------------- | ---------------------------------------------------------------------------------- |
| rolling | StatsSummary2D | A new statistical aggregate produced by combining the input statistical aggregates |
