From 3e37926450ef4bb63ff8c10fb67a5baf821580d8 Mon Sep 17 00:00:00 2001 From: Anna Saiapina Date: Thu, 4 Jul 2024 13:58:37 +0000 Subject: [PATCH] Remove calls with abandoned as NULL --- definitions/staging/stg_calls.sqlx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/definitions/staging/stg_calls.sqlx b/definitions/staging/stg_calls.sqlx index d07eab7..fe83f5c 100644 --- a/definitions/staging/stg_calls.sqlx +++ b/definitions/staging/stg_calls.sqlx @@ -16,7 +16,8 @@ select *, OVER (PARTITION BY SESSION_ID, TIMESTAMP, DNIS) row_number from ${ref("pphe_five9_raw","calls_*")} -${ when(incremental(), `where _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d',current_date("Europe/Amsterdam"))`) }) +where ABANDONED is not null +${ when(incremental(), `and _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d',current_date("Europe/Amsterdam"))`) }) select DAY_OF_WEEK, CALL_ID, CAMPAIGN, @@ -27,7 +28,7 @@ select DAY_OF_WEEK, CALL_TIME, RING_TIME, TALK_TIME, - AFTER_CALL_WORK_TIME, + AFTER_CALL_WORK_TIME,-- ABANDONED, COALESCE(AGENT_GROUP, '0') AS AGENT_GROUP, CALLS,