> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify-poc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# rollup()

> Combine multiple MinNBy aggregates

<Icon icon="tag" iconType="duotone" /> Since [1.16.0][toolkit-1.16.0]

This aggregate combines the aggregates generated by other `min_n_by`
aggregates and returns the minimum values and associated data found
across all the aggregated data.

## Arguments

The syntax is:

```sql theme={"dark"}
rollup(
    agg MinNBy
) MinNBy
```

| Name  | Type   | Default | Required | Description                   |
| ----- | ------ | ------- | -------- | ----------------------------- |
| `agg` | MinNBy | -       | ✔        | The aggregates being combined |

## Returns

| Column | Type   | Description                                       |
| ------ | ------ | ------------------------------------------------- |
| rollup | MinNBy | An aggregate over all of the contributing values. |

[toolkit-1.16.0]: https://github.com/timescale/timescaledb-toolkit/releases/tag/1.16.0
