Skip to content

Instantly share code, notes, and snippets.

Avatar

Leigha Jarett leighajarett

View GitHub Profile
@leighajarett
leighajarett / code.gs
Created Nov 15, 2021
Example of using Apps Script to populate Google Slides with data from BigQuery
View code.gs
//// Using BigQuery query results to populate a template slide deck ////
// This object defines the queries associate with each of the params used in the template
// Note that you may want to use functions defined within BigQuery instead of parameterized queries
var queryObj = {
"new_cust": "SELECT COUNT(*) FROM `looker-private-demo.retail.customers` as custs " +
"JOIN `looker-private-demo.retail.transaction_detail` as trans ON custs.id = trans.customer_id " +
", UNNEST(trans.line_items) as line_items " +
"WHERE TIMESTAMP_TRUNC(custs.created_at,WEEK) = @week " +
"AND line_items.product_id in (select id from `looker-private-demo.retail.products` where category = @team);",
View sample_slides_appscript.gs
//// Using BigQuery query results to populate a template slide deck ////
// This object defines the queries associate with each of the params used in the template
var queryObj = {
"new_cust": "SELECT COUNT(*) FROM `looker-private-demo.retail.customers` as custs " +
"JOIN `looker-private-demo.retail.transaction_detail` as trans ON custs.id = trans.customer_id " +
", UNNEST(trans.line_items) as line_items " +
"WHERE TIMESTAMP_TRUNC(custs.created_at,WEEK) = @week " +
"AND line_items.product_id in (select id from `looker-private-demo.retail.products` where category = @team);",
"rep_rate": "WITH repeat_orders as " +
View Google Trends Sample Queries
@leighajarett
leighajarett / gis_examples.ipynb
Last active Apr 16, 2022
Examples for leveraging the BigQuery Public Geo Boundaries tables for geospatial analytics
View gis_examples.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leighajarett
leighajarett / PTD_Analysis.ipynb
Created Apr 13, 2021
BigQuery Period to Date
View PTD_Analysis.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leighajarett
leighajarett / bq_var.sql
Last active Apr 5, 2021
Declare a Variable in BigQuery
View bq_var.sql
-- Declare a variable to hold the timeframe (month, quarter or year)
DECLARE timeframe STRING DEFAULT "month";
View Titanic.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.