From 68815b853de1ff1dcfd3d9c93cb3fd369b8a2a6a Mon Sep 17 00:00:00 2001 From: Scott Sugar Date: Wed, 8 May 2024 16:04:42 +0700 Subject: [PATCH 1/2] Fabric adapter doesnt work with default cents_to_dollars macro --- macros/cents_to_dollars.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/macros/cents_to_dollars.sql b/macros/cents_to_dollars.sql index 3593a3fb..0113ad3e 100644 --- a/macros/cents_to_dollars.sql +++ b/macros/cents_to_dollars.sql @@ -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 %} From a75613b709a50333891b4029bc309a705f33695f Mon Sep 17 00:00:00 2001 From: gwen windflower <91998347+gwenwindflower@users.noreply.github.com> Date: Thu, 4 Jul 2024 11:26:22 -0500 Subject: [PATCH 2/2] fix(metrics): food+drink revenue use 'is true' not =1 --- models/marts/order_items.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/marts/order_items.yml b/models/marts/order_items.yml index 339c4769..e46d764b 100644 --- a/models/marts/order_items.yml +++ b/models/marts/order_items.yml @@ -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