Created
February 4, 2021 21:52
-
-
Save AdenForshaw/9b89d252af43dc66ae30609c5d3f9955 to your computer and use it in GitHub Desktop.
[Percentiles in BigQuery]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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