generated from dbt-labs/jaffle-shop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Angelina Jolie
committed
Sep 26, 2024
1 parent
08e7391
commit 50c423a
Showing
1 changed file
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
||
|
||
|
||
|
||
|