Skip to content

Commit

Permalink
Merge pull request #2 from dbt-labs/Jolie-patch-2
Browse files Browse the repository at this point in the history
Jolie patch 2
  • Loading branch information
faithebear authored Sep 26, 2024
2 parents 4e3bc51 + 50c423a commit 4ca32fc
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 3 deletions.
63 changes: 63 additions & 0 deletions models/marts/customers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
semantic_models:
- name: customers
model: ref('customers')
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






6 changes: 3 additions & 3 deletions package-lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ packages:
version: 1.1.1
- package: calogica/dbt_date
version: 0.10.0
- package: dbt-labs/audit_helper
version: 0.12.0
sha1_hash: 974021e878d1894c35a21fb44fb0b6bd04f07078
- git: https://github.com/dbt-labs/dbt-audit-helper.git
revision: c0be07f84e61dd01517292a15a2c084af9c95f01
sha1_hash: da0d5b1d5a48f6504805f6b1d5a0b2f9f233f34c

0 comments on commit 4ca32fc

Please sign in to comment.