forked from dbt-labs/jaffle-shop-classic
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98faa16
commit 142d157
Showing
6 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: 2 | ||
|
||
exposures: | ||
- name: fnl_finance_returns_by_customer | ||
label: fnl_finance_returns_by_customer | ||
description: Inksacio data app with dashboard for dbt certification | ||
type: dashboard | ||
url: https://inksacio.eks.octopus.engineering/my_certification_dashboard/ | ||
owner: | ||
email: example.email@octoenergy.com | ||
depends_on: | ||
- ref('fnl_finance_returns_by_customer') | ||
- name: fnl_sales_newcustomers | ||
label: fnl_sales_newcustomers | ||
description: Inksacio data app with dashboard for dbt certification | ||
type: dashboard | ||
url: https://inksacio.eks.octopus.engineering/my_certification_dashboard/ | ||
owner: | ||
email: example.email@octoenergy.com | ||
depends_on: | ||
- ref('fnl_sales_newcustomers') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: fnl_finance_returns_by_customer | ||
meta: | ||
owner: 'example.email@octoenergy.com' | ||
description: | ||
Table with value of completed returns by customer | ||
columns: | ||
- name: customer_id | ||
tests: | ||
- unique | ||
- not_null | ||
- name: total_returned | ||
description: Total value of completed returns made by customer, excluding pending returns |
6 changes: 6 additions & 0 deletions
6
jaffle_shop/models/final/finance/fnl_finance_returns_by_customer.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SELECT | ||
customer_id, | ||
SUM(amount) AS total_returned | ||
FROM {{ ref('wh_orders') }} | ||
WHERE `status` = 'returned' | ||
GROUP BY customer_id |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: fnl_sales_newcustomers | ||
meta: | ||
owner: 'example.email@octoenergy.com' | ||
description: | ||
The customer count by month for customers making their first order | ||
columns: | ||
- name: first_order_month | ||
tests: | ||
- unique | ||
- not_null |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
SELECT | ||
DATE_TRUNC('month', first_order) AS first_order_month, | ||
COUNT(DISTINCT customer_id) AS number_first_orders | ||
FROM {{ ref('wh_customers') }} | ||
GROUP BY first_order_month |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fct_name,column_name,id_to_exclude,comment | ||
fct_staging_dependent_on_staging,parent,stg_customers_pii,Scrubbing pii permitted in staging layer. |