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

# min_val()

> Get the minimum value from a `tdigest`

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

Get the minimum value from a `tdigest`. This accessor allows you to calculate the minimum alongside percentiles, without
needing to create two separate aggregates from the same raw data.

## Samples

Get the minimum of the integers from 1 to 100.

```sql theme={"dark"}
SELECT min_val(tdigest(100, data))
  FROM generate_series(1, 100) data;
```

```
min_val
---------
      1
```

## Arguments

The syntax is:

```sql theme={"dark"}
min_val(
  digest TDigest
) RETURNS DOUBLE PRECISION
```

| Name   | Type    | Default | Required | Description                                  |
| ------ | ------- | ------- | -------- | -------------------------------------------- |
| digest | TDigest | -       | ✔        | The digest to extract the minimum value from |

## Returns

| Column   | Type             | Description                                  |
| -------- | ---------------- | -------------------------------------------- |
| min\_val | DOUBLE PRECISION | The minimum value entered into the `tdigest` |

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