From 9f56d38e8a6047b4e3db65db6699f572598c1281 Mon Sep 17 00:00:00 2001 From: Niall Woodward Date: Wed, 26 Jul 2023 16:53:32 +0100 Subject: [PATCH] Coalesce to 0 --- models/hourly_spend.sql | 2 +- models/staging/stg_data_transfer_history.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/hourly_spend.sql b/models/hourly_spend.sql index 0893130..5d048be 100644 --- a/models/hourly_spend.sql +++ b/models/hourly_spend.sql @@ -96,7 +96,7 @@ data_transfer_spend_hourly as ( null as storage_type, null as warehouse_name, null as database_name, - stg_usage_in_currency_daily.usage_in_currency/hours.hours_thus_far as spend, + coalesce(stg_usage_in_currency_daily.usage_in_currency/hours.hours_thus_far, 0) as spend, spend as spend_net_cloud_services, stg_usage_in_currency_daily.currency as currency from hours diff --git a/models/staging/stg_data_transfer_history.sql b/models/staging/stg_data_transfer_history.sql index 4a17e31..5a259b0 100644 --- a/models/staging/stg_data_transfer_history.sql +++ b/models/staging/stg_data_transfer_history.sql @@ -7,4 +7,4 @@ select target_region, bytes_transferred, transfer_type -from {{ source('snowflake_account_usage', 'data_transfer_history')}} +from {{ source('snowflake_account_usage', 'data_transfer_history') }}