Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update orders.yml #72

Merged
merged 10 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions models/marts/customer360/customers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ semantic_models:
type: categorical
- name: first_ordered_at
type: time
expr: cast(first_orderered_at as DATE)
type_params:
time_granularity: day
- name: last_ordered_at
Expand Down
13 changes: 7 additions & 6 deletions models/marts/customer360/order_items.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ semantic_models:
expr: product_id
dimensions:
- name: ordered_at
expr: cast(ordered_at as DATETIME)
expr: cast(ordered_at as DATE)
type: time
type_params:
time_granularity: day
Expand Down Expand Up @@ -73,11 +73,12 @@ metrics:
type_params:
measure: order_cost
- name: median_revenue
description: The median revenue for each order item. Excludes tax.
type: simple
label: Median Revenue
type_params:
measure: median_revenue
description: The median revenue generated for each order item.
agg: percentile
agg_params:
percentile: .5
use_approximate_percentile: True
expr: product_price
- name: food_revenue
description: The revenue from food in each order
label: Food Revenue
Expand Down
4 changes: 2 additions & 2 deletions models/marts/customer360/orders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ semantic_models:
expr: customer_id
dimensions:
- name: ordered_at
expr: ordered_at
expr: cast(ordered_at as DATE)
type: time
type_params:
time_granularity: day
Expand Down Expand Up @@ -152,4 +152,4 @@ metrics:
type_params:
measure: order_count
window: 7 days
# // test
# // test
Loading