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
13 changes: 12 additions & 1 deletion dbt-bigquery/models/dbt_orders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ models:
categories:
- verified
- sales
orders_per_customer_per_day:
type: number
sql: "SAFE_DIVIDE(COUNT(${TABLE}.order_id), NULLIF(COUNT(DISTINCT ${TABLE}.user_id) * COUNT(DISTINCT DATE(${order_date})), 0))"
label: 'Orders per Customer per Day'
description: 'Average number of orders per active customer per calendar day in the filtered period. This normalizes for shorter and longer months so February is comparable to January.'
format: '0.000'
spotlight:
visibility: show
categories:
- verified
- sales
dimension:
type: string
- name: order_date
Expand Down Expand Up @@ -351,7 +362,7 @@ models:
count_distinct_user_id:
type: count_distinct
label: 'Unique Customers'
description: 'Number of unique customers who placed orders.'
description: 'Number of unique customers who placed at least one order in the filtered period. This is not a day-normalized or month-normalized metric.'
spotlight:
visibility: hide
categories:
Expand Down
13 changes: 12 additions & 1 deletion dbt-bigquery/models/dbt_orders_no_preagg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ models:
categories:
- verified
- sales
orders_per_customer_per_day:
type: number
sql: "SAFE_DIVIDE(COUNT(${TABLE}.order_id), NULLIF(COUNT(DISTINCT ${TABLE}.user_id) * COUNT(DISTINCT DATE(${order_date})), 0))"
label: 'Orders per Customer per Day'
description: 'Average number of orders per active customer per calendar day in the filtered period. This normalizes for shorter and longer months so February is comparable to January.'
format: '0.000'
spotlight:
visibility: show
categories:
- verified
- sales
dimension:
type: string
- name: order_date
Expand Down Expand Up @@ -293,7 +304,7 @@ models:
count_distinct_user_id:
type: count_distinct
label: 'Unique Customers'
description: 'Number of unique customers who placed orders.'
description: 'Number of unique customers who placed at least one order in the filtered period. This is not a day-normalized or month-normalized metric.'
spotlight:
visibility: hide
categories:
Expand Down
Loading