Skip to content

Instantly share code, notes, and snippets.

View CrystalDave's full-sized avatar

David Ross CrystalDave

View GitHub Profile
@CrystalDave
CrystalDave / CrUX_CLS.sql
Last active November 16, 2023 08:52
CrUX BigQuery to Sheets Connector Scripts
--Query variables in Google Sheets connector start with `@`
--Add `DECLARE` lines & remove `@` before variables if testing in BigQuery console
--DECLARE CLS_CLAMP INT64 DEFAULT 1000;
--DECLARE DOMAIN STRING DEFAULT "https://www.example.com";
--DECLARE MONTH_BEFORE INT64 DEFAULT 202308;
--DECLARE QUERY_MONTH INT64 DEFAULT 202309;
SELECT
yyyymm, "total" as device,
IF(cls.start > @CLS_CLAMP, @CLS_CLAMP, cls.start) as cls_bucket,
ROUND(SUM(cls.density), 3) as cls_total

Keybase proof

I hereby claim:

  • I am crystaldave on github.
  • I am crystaldave (https://keybase.io/crystaldave) on keybase.
  • I have a public key whose fingerprint is 832D 6EBC B779 05C4 FA70 06A9 438E C780 F340 4A0F

To claim this, I am signing this object: