Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/customers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ with customers as (

orders as (

select * from {{ ref('stg_orders') }}
select * from {{ ref('fac_orders') }}

),

Expand Down
29 changes: 29 additions & 0 deletions models/fac_orders.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

with orders as (
select * from {{ ref('stg_orders') }}
),

customers as (
select * from {{ ref('stg_customers') }}
),

payments as (
select
*
from {{ ref('stg_payments') }}
)

select
orders.order_id,
orders.customer_id,
customers.first_name as customer_first_name,
customers.last_name as customer_last_name,
orders.order_date,
orders.status,
1 as payment_count,
payments.amount as total_amount
from orders
left join customers
on orders.customer_id = customers.customer_id
left join payments
on orders.order_id = payments.order_id
8 changes: 8 additions & 0 deletions package-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
packages:
- package: data-mie/dbt_profiler
version: 0.8.1
- package: dbt-labs/dbt_utils
version: 0.9.6
- package: dbt-labs/audit_helper
version: 0.11.0
sha1_hash: 603a47dea852f3eaf2f6a828103b61386041f687
Loading