percentile()

percentile(n, col) returns the n-th percentile value of the provided column in the input datastream. A value at the n-th percentile means that n% of the values in the input datastream are below that value.

n must be a numeric value between 0 and 100. Floating point numbers are accepted.

If the provided column does not have numeric values or does not exist, percentile will return null; otherwise, percentile will always return a numeric value that was part of the input datastream.

Technical Notes

Returns

A table with one row and one column, called @q.value.

Examples

# Return the median (value at the 50th percentile) of `elapsed_ms` column
* | percentile(50, elapsed_ms)

# Return the value at the 99.9th percentile of `elapsed_ms` column.
* | percentile(99.9, elapsed_ms)

Last updated

Was this helpful?