diff --git a/models/marts/customer360/customers.yml b/models/marts/customer360/customers.yml index 80c288d..0938931 100644 --- a/models/marts/customer360/customers.yml +++ b/models/marts/customer360/customers.yml @@ -43,6 +43,7 @@ semantic_models: type: categorical - name: first_ordered_at type: time + expr: cast(first_ordered_at as DATE) type_params: time_granularity: day - name: last_ordered_at diff --git a/models/marts/customer360/order_items.yml b/models/marts/customer360/order_items.yml index f577416..f1e4482 100644 --- a/models/marts/customer360/order_items.yml +++ b/models/marts/customer360/order_items.yml @@ -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 @@ -41,7 +41,10 @@ semantic_models: expr: case when is_drink_item = 1 then product_price else 0 end - name: median_revenue description: The median revenue generated for each order item. - agg: median + agg: percentile + agg_params: + percentile: .5 + use_approximate_percentile: True expr: product_price groups: @@ -125,8 +128,8 @@ metrics: type: cumulative type_params: measure: revenue - cumulative_type_params: - period_agg: last + # cumulative_type_params: + # period_agg: last saved_queries: - name: order_metrics diff --git a/models/marts/customer360/orders.yml b/models/marts/customer360/orders.yml index a4e3cc5..ccee230 100644 --- a/models/marts/customer360/orders.yml +++ b/models/marts/customer360/orders.yml @@ -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 @@ -152,4 +152,4 @@ metrics: type_params: measure: order_count window: 7 days -# // test \ No newline at end of file +# // test diff --git a/requirements.txt b/requirements.txt index 5b0f807..b6dc0cf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ -dbt-metricflow[snowflake]==0.0.5 +dbt-core +dbt-snowflake pre-commit~=3.0.4 sqlfluff-templater-dbt~=2.0.0a5 sqlfluff~=2.0.0a5