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.
Merge pull request #2 from dbt-labs/Jolie-patch-2
Jolie patch 2
- Loading branch information
Showing
2 changed files
with
66 additions
and
3 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 |
---|---|---|
@@ -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 | ||
|
||
|
||
|
||
|
||
|
||
|
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