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
with customer as ( | |
select * except(rn) from ( | |
select *,row_number() over (partition by customer_id order by _DATA_DATE desc) rn from `project`.`adwords`.`ads_Customer_1234567890` | |
) | |
where rn=1 | |
), | |
campaigns as ( | |
select * except(rn) from ( | |
select *,row_number() over (partition by campaign_id order by _DATA_DATE desc) rn from `project`.`adwords`.`ads_Campaign_1234567890` | |
) |
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 | |
COALESCE(a.date, s.date) as date, | |
COALESCE(a.campaign, s.campaign) as campaign, | |
IFNULL(a.spent, 0) as spent, | |
IFNULL(a.impressions, 0) as impressions, | |
IFNULL(a.clicks, 0) as clicks, | |
IFNULL(s.sessions, 0) as sessions, | |
IFNULL(s.conversions, 0) as conversions | |
FROM | |
Ads a |
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
CREATE OR REPLACE MODEL `your-project.arima_test.purchase_forecast` | |
OPTIONS(model_type='ARIMA_PLUS', time_series_timestamp_col='date', time_series_data_col='daily_purchases') | |
AS | |
SELECT | |
PARSE_DATE('%Y%m%d', event_date) as date, | |
COUNTIF(event_name = 'purchase') as daily_purchases | |
FROM | |
`bigquery-public-data.ga4_obfuscated_sample_ecommerce.events_*` | |
WHERE | |
_TABLE_SUFFIX BETWEEN '20201101' AND '20211231' |
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 | |
user_email, | |
SUM(total_bytes_billed) AS bytes_billed_last_month | |
FROM | |
`region-europe-west1`.INFORMATION_SCHEMA.JOBS_BY_PROJECT | |
WHERE | |
EXTRACT(MONTH FROM creation_time) = EXTRACT(MONTH FROM CURRENT_DATE()) - 1 | |
GROUP BY | |
user_email | |
ORDER BY |
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
{{ config(materialized = 'table') }} | |
{%- call statement('create_ext_table', fetch_result=False) -%} | |
CREATE OR REPLACE EXTERNAL TABLE {{ this.database+"."+this.schema+"."+this.table+"_ref" }} ( | |
Student_Name STRING, | |
Gender STRING, | |
Class_Level STRING, | |
Home_State STRING, | |
Major STRING, |
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
<body lj-type="stage"> | |
<div lj-type="layer" id="content-layer" lj-fit-to="responsive-width" lj-transition="fade"> | |
<div lj-type="frame" id="home"> | |
Hello World | |
<br> | |
<a href="#more">Next</a> | |
</div> | |
<div lj-type="frame" id="more"> | |
More content... | |
<br> |
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
<html> | |
<head> | |
<script src="https://cdn.layerjs.org/libs/layerjs/layerjs-0.5.2.min.js" defer=""></script> | |
<link href="https://cdn.layerjs.org/libs/layerjs/layerjs-0.5.2.css" type="text/css" rel="stylesheet"> | |
<link href="style.css" rel="stylesheet"> | |
</head> | |
<body lj-type="stage"> | |
<div lj-type="layer" id="content-layer" lj-fit-to="responsive-width"> | |
<div lj-type="frame" id="home"> | |
Hello World |