Skip to content

Commit 1bc6987

Browse files
committed
Add tests to customer_order_pattern and customer_segments
Signed-off-by: Even Wei <[email protected]>
1 parent 0e84543 commit 1bc6987

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

models/schema.yml

+50
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,56 @@ models:
2929
- name: total_order_amount
3030
description: Total value (AUD) of a customer's orders
3131

32+
- name: customer_segments
33+
description: This table categorizes customers based on their ordering behavior and value to the company, using derived metrics from their order history.
34+
35+
columns:
36+
- name: customer_id
37+
description: This is a unique identifier for a customer.
38+
tests:
39+
- unique
40+
- not_null
41+
42+
- name: number_of_orders
43+
description: Count of the number of orders a customer has placed.
44+
45+
- name: customer_lifetime_value
46+
description: Total value (in currency) of all orders placed by a customer over their lifetime.
47+
48+
- name: order_frequency_segment
49+
description: Categorization of customers based on how frequently they place orders.
50+
51+
- name: value_segment
52+
description: Categorization of customers based on the monetary value they bring to the company.
53+
tests:
54+
- accepted_values:
55+
values: ['High Value', 'Medium Value', 'Low Value']
56+
57+
- name: customer_order_pattern
58+
description: This table provides detailed insights into the ordering patterns of customers, including the frequency and recency of their orders.
59+
60+
columns:
61+
- name: customer_id
62+
description: This is a unique identifier for a customer.
63+
tests:
64+
- unique
65+
- not_null
66+
67+
- name: first_order
68+
description: Date (UTC) of a customer's first order.
69+
70+
- name: most_recent_order
71+
description: Date (UTC) of a customer's most recent order.
72+
73+
- name: number_of_orders
74+
description: Count of the number of orders a customer has placed.
75+
76+
- name: days_active
77+
description: The total number of days between a customer's first and most recent orders.
78+
79+
- name: avg_days_between_orders
80+
description: Average number of days between consecutive orders for a customer.
81+
3282
- name: orders
3383
description: This table has basic information about orders, as well as some derived facts based on payments
3484

0 commit comments

Comments
 (0)