Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Percentiles in BigQuery]
select
percentiles[offset(10)] as p10,
percentiles[offset(25)] as p25,
percentiles[offset(50)] as p50,
percentiles[offset(75)] as p75,
percentiles[offset(90)] as p90,
from (
select approx_quantiles(char_length(text), 100) percentiles
from `bigquery-public-data.hacker_news.full`
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment