Skip to content

Commit

Permalink
beep boop
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelina Jolie committed Sep 26, 2024
1 parent 08e7391 commit 50c423a
Showing 1 changed file with 60 additions and 2 deletions.
62 changes: 60 additions & 2 deletions models/marts/customers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
semantic_models:
- name: customers
model: ref('customers')
# defaults:
# agg_time_dimension: first_ordered_at
defaults:
agg_time_dimension: first_ordered_at
entities:
- name: customer
type: primary
expr: customer_id
dimensions:
- name: customer_name
type: categorical
- name: customer_type
type: categorical
- name: first_ordered_at
type: time
type_params:
time_granularity: day
- name: last_ordered_at
type: time
type_params:
time_granularity: day
measures:
- name: customers
description: Count of unique customers
agg: count_distinct
- name: count_lifetime_orders
description: Total count of orders per customer.
agg: sum
- name: lifetime_spend_pretax
description: Customer lifetime spend before taxes.
agg: sum
- name: lifetime_spend
description: Gross customer lifetime spend inclusive of taxes.
agg: sum
metrics:
- name: lifetime_spend_pretax
description: Customer's lifetime spend before tax
label: LTV Pre-tax
type: simple
type_params:
measure: lifetime_spend_pretax
- name: count_lifetime_orders
description: Count of lifetime orders
label: Count Lifetime Orders
type: simple
type_params:
measure: count_lifetime_orders
- name: average_order_value
description: LTV pre-tax / number of orders
label: Average Order Value
type: derived
type_params:
expr: lifetime_spend_pretax / count_lifetime_orders
metrics:
- count_lifetime_orders
- lifetime_spend_pretax






0 comments on commit 50c423a

Please sign in to comment.