Skip to content

Commit

Permalink
Correct fnl model for customer returns
Browse files Browse the repository at this point in the history
Signed-off-by: Joanna Lau <[email protected]>
  • Loading branch information
Joanna Lau committed Aug 14, 2023
1 parent f48b490 commit b29cee8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions jaffle_shop/models/final/finance/_models.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: 2

exposures:
- name: fnl_finance_customerorders
- name: fnl_finance_customerreturns
description: Data source for dashboard tool
type: dashboard
url: https://inksacio.eks.octopus.engineering/my_certification_dashboard/
depends_on:
- ref('fnl_finance_customerorders')
- ref('fnl_finance_customerreturns')
models:
- name: fnl_finance_customerorders
description: One row per customer. Gives the total value of orders made by that customer
- name: fnl_finance_customerreturns
description: One row per customer. Gives the total value of returns made by that customer
columns:
- name: customer_id
description: This is a unique identifier for a customer
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SELECT
customer_id
, SUM(amount) AS total_returned_amount
FROM {{ ref('wh_orders') }}
WHERE status IN ('return_pending', 'returned')
GROUP BY customer_id
File renamed without changes.

0 comments on commit b29cee8

Please sign in to comment.