> ## 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.

# num_vals()

> Calculate the number of values in a one-dimensional statistical aggregate

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

Calculate the number of values contained in a statistical aggregate.

## Samples

Calculate the number of values from 0 to 100, inclusive:

```sql theme={"dark"}
SELECT num_vals(stats_agg(data))
  FROM generate_series(0, 100) data;
```

```
num_vals
--------
101
```

## Arguments

The syntax is:

```sql theme={"dark"}
num_vals(
  summary StatsSummary1D
) RETURNS BIGINT
```

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

## Returns

| Column    | Type   | Description                                       |
| --------- | ------ | ------------------------------------------------- |
| num\_vals | BIGINT | The number of values in the statistical aggregate |

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