mirror of
https://gitlab.com/cief-data/dbt_cloud.git
synced 2026-08-19 04:14:00 +00:00
Logic fix for is_on_time_delivery
This commit is contained in:
@@ -197,6 +197,7 @@ fct_and_dim_joins AS (
|
||||
CASE
|
||||
-- On-time boolean is null when order is not complete
|
||||
WHEN account_verified_payment_datetime IS NULL THEN NULL
|
||||
WHEN estimated_order_delivery_datetime_website_sla IS NULL THEN NULL
|
||||
WHEN estimated_order_delivery_datetime_website_sla > orders.operation_uploaded_bank_slip_datetime THEN 1
|
||||
ELSE 0
|
||||
END AS is_on_time_delivery_website_sla,
|
||||
@@ -205,6 +206,7 @@ fct_and_dim_joins AS (
|
||||
CASE
|
||||
-- On-time boolean is null when order is not complete
|
||||
WHEN account_verified_payment_datetime IS NULL THEN NULL
|
||||
WHEN estimated_order_delivery_datetime_customer_expectation IS NULL THEN NULL
|
||||
WHEN estimated_order_delivery_datetime_customer_expectation > orders.operation_uploaded_bank_slip_datetime THEN 1
|
||||
ELSE 0
|
||||
END AS is_on_time_delivery_customer_expectation,
|
||||
|
||||
Reference in New Issue
Block a user