---
title: approx_percentile() | Tiger Data Docs
description: Estimate the value at a given percentile from a `uddsketch`
---

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

Estimate the approximate value at a percentile from a `uddsketch` aggregate.

## Samples

Estimate the value at the first percentile, given a sample containing the numbers from 0 to 100.

```
SELECT
  approx_percentile(0.01, uddsketch(data))
FROM generate_series(0, 100) data;
```

```
approx_percentile
-------------------
            0.999
```

## Arguments

The syntax is:

```
approx_percentile(
  percentile DOUBLE PRECISION,
  uddsketch  UddSketch
) RETURNS DOUBLE PRECISION
```

| Name       | Type             | Default | Required | Description                                                      |
| ---------- | ---------------- | ------- | -------- | ---------------------------------------------------------------- |
| percentile | DOUBLE PRECISION | -       | ✔        | the percentile to compute. Must be within the range `[0.0, 1.0]` |
| sketch     | UddSketch        | -       | ✔        | the `uddsketch` aggregate                                        |

## Returns

| Column             | Type             | Description                                      |
| ------------------ | ---------------- | ------------------------------------------------ |
| approx\_percentile | DOUBLE PRECISION | The estimated value at the requested percentile. |
