SQL: Query used in online guide for ttfb doesn't return any results in BigQuery

84 Views Asked by At

To create automatic sitespeed reports I have been following this guide: How to create a site speed report based on crux

However when I paste (and change the crux database to a specific country and month) the following code. It doesn't return any results. Of course, I did change the website in the code.

 select
yyyymm,
sum(case when ttfb.start < 201 then ttfb.density else 0 end) as fast,
sum(case when ttfb.start > 200 and ttfb.start < 1001 then ttfb.density else 0 end) as average,
sum(case when ttfb.start > 1000 then ttfb.density else 0 end) as slow
from(
select 
*, _TABLE_SUFFIX AS yyyymm
FROM
`chrome-ux-report.country_ca.202012*`
where not regexp_contains(_TABLE_SUFFIX, ".*20(20|21).*") and origin='https://mywebsite.com/'),
UNNEST(experimental.time_to_first_byte.histogram.bin) AS ttfb
group by yyyymm 
order by yyyymm asc 

I have also tried running

FROM
`chrome-ux-report.all*`

Also return no results.

Any ideas as to why this might be? Help is appreciated!

EDIT: When I put the same code into Google Spreadsheets, it says there are no parameters. Could that have anything to do with it?

0

There are 0 best solutions below