Skip to content

Commit

Permalink
fix(metrics): food+drink revenue use 'is true' not =1 (#54)
Browse files Browse the repository at this point in the history
Snowflake doesn't mind if you use =0/1 for booleans, but BigQuery, our
friend BQ? He does not like it. This makes him happier and is more
correct/resilient across dialects.
  • Loading branch information
gwenwindflower authored Jul 4, 2024
2 parents 10846ee + a75613b commit 5ac09d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/marts/order_items.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ semantic_models:
- name: food_revenue
description: The revenue generated for each order item. Revenue is calculated as a sum of revenue associated with each product in an order.
agg: sum
expr: case when is_food_item = 1 then product_price else 0 end
expr: case when is_food_item is true then product_price else 0 end
- name: drink_revenue
description: The revenue generated for each order item. Revenue is calculated as a sum of revenue associated with each product in an order.
agg: sum
expr: case when is_drink_item = 1 then product_price else 0 end
expr: case when is_drink_item is true then product_price else 0 end
- name: median_revenue
description: The median revenue generated for each order item.
agg: median
Expand Down

0 comments on commit 5ac09d5

Please sign in to comment.