From 85e7d4e61ba569557430f4a26315dd9882156fb9 Mon Sep 17 00:00:00 2001 From: Yam ZhengLim Date: Mon, 29 Apr 2024 04:22:58 +0000 Subject: [PATCH] Fix time logic operator --- models/marts/reporting/rep_exchange__daily_orders.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/marts/reporting/rep_exchange__daily_orders.sql b/models/marts/reporting/rep_exchange__daily_orders.sql index d7a5a8e..08640dc 100644 --- a/models/marts/reporting/rep_exchange__daily_orders.sql +++ b/models/marts/reporting/rep_exchange__daily_orders.sql @@ -212,7 +212,7 @@ fct_and_dim_joins AS ( WHEN service_type IN ('BA', 'RECEIVED-ON-BEHALF') THEN NULL WHEN transaction_status NOT IN ('UPLOADED_BANK_SLIP') THEN NULL WHEN order_created_datetime < '2023-01-01' THEN NULL - WHEN estimated_order_delivery_datetime_website_sla > orders.operation_uploaded_bank_slip_datetime THEN 1 + WHEN estimated_order_delivery_datetime_website_sla >= orders.operation_uploaded_bank_slip_datetime THEN 1 WHEN estimated_order_delivery_datetime_website_sla < orders.operation_uploaded_bank_slip_datetime THEN 0 ELSE -999 END AS is_on_time_delivery_website_sla, @@ -223,7 +223,7 @@ fct_and_dim_joins AS ( WHEN service_type IN ('BA', 'RECEIVED-ON-BEHALF') THEN NULL WHEN transaction_status NOT IN ('UPLOADED_BANK_SLIP') THEN NULL WHEN order_created_datetime < '2023-01-01' THEN NULL - WHEN estimated_order_delivery_datetime_customer_expectation > orders.operation_uploaded_bank_slip_datetime THEN 1 + WHEN estimated_order_delivery_datetime_customer_expectation >= orders.operation_uploaded_bank_slip_datetime THEN 1 WHEN estimated_order_delivery_datetime_customer_expectation < orders.operation_uploaded_bank_slip_datetime THEN 0 ELSE -999 END AS is_on_time_delivery_customer_expectation,