Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Ganz committed Sep 12, 2024
2 parents 16a7ad6 + 323cd5d commit 0a10ae9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions macros/cents_to_dollars.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
{% macro bigquery__cents_to_dollars(column_name) %}
round(cast(({{ column_name }} / 100) as numeric), 2)
{% endmacro %}

{% macro fabric__cents_to_dollars(column_name) %}
cast({{ column_name }} / 100 as numeric(16,2))
{% endmacro %}
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 0a10ae9

Please sign in to comment.