Versions:
approx_percentile_rank() ToolkitTimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
Toolkit
TimescaleDB Toolkit functions are available under Timescale Community Edition. They are automatically included with Timescale Cloud. Click to learn more.
Estimate what percentile a given value would be located at in a UddSketch
.
approx_percentile_rank(
value DOUBLE PRECISION,
sketch UddSketch
) RETURNS UddSketch
- For more information about percentile approximation algorithms, see advanced aggregation methods.
- For more information about percentile approximation functions, see the hyperfunctions documentation.
Required arguments
Name | Type | Description |
---|---|---|
value | DOUBLE PRECISION | The value to estimate the percentile of |
sketch | UddSketch | The sketch to compute the percentile on |
Returns
Column | Type | Description |
---|---|---|
approx_percentile_rank | DOUBLE PRECISION | The estimated percentile associated with the provided value |
Sample usage
SELECT
approx_percentile_rank(99, percentile_agg(data))
FROM generate_series(0, 100) data;
approx_percentile_rank
----------------------------
0.9851485148514851
Found an issue on this page?
Report an issue!