Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit 89946f0

Browse files
added final models and reverted wh_ suffix change
1 parent c4e15ec commit 89946f0

6 files changed

Lines changed: 27 additions & 0 deletions

File tree

jaffle_shop/models/final/finance/_models.yml

Whitespace-only changes.

jaffle_shop/models/final/finance/fnl_returned_order_value.sql

Whitespace-only changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
3+
models:
4+
name: fnl_monthly_customer_count
5+
meta:
6+
owner: kensuke.morris@octoenergy.com
7+
description: |
8+
One row per customer count for each month based on their first orders.
9+
columns:
10+
- name: first_order_month
11+
description: Primary key
12+
tests:
13+
- unique
14+
- not_null
15+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
WITH customer_orders AS (
2+
SELECT
3+
customer_id
4+
, DATE_FORMAT(first_order, 'MMMM') As order_month
5+
FROM {{ ref('wh_customers') }}
6+
)
7+
8+
SELECT
9+
first_order AS first_order_month
10+
, COUNT(*) AS customer_count
11+
FROM customer_orders
12+
GROUP BY first_order
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)