> ## 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()

> Get the number of values contained in a `uddsketch`

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

Get the number of values contained in a `uddsketch`. This accessor allows you to calculate a count alongside
percentiles, without needing to create two separate aggregates from the same raw data.

## Samples

Count the number of integers from 0 to 100.

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

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

## Arguments

The syntax is:

```sql theme={"dark"}
num_vals(
  sketch UddSketch
) RETURNS DOUBLE PRECISION
```

| Name   | Type      | Default | Required | Description                                          |
| ------ | --------- | ------- | -------- | ---------------------------------------------------- |
| sketch | UddSketch | -       | ✔        | The `uddsketch` to extract the number of values from |

## Returns

| Column    | Type             | Description                              |
| --------- | ---------------- | ---------------------------------------- |
| num\_vals | DOUBLE PRECISION | The number of values in the `uddsketch`. |

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