From 67f3e0a0a2157d02586fe75f9c5038593b8c169b Mon Sep 17 00:00:00 2001 From: Anna Saiapina Date: Mon, 11 Mar 2024 10:38:45 +0000 Subject: [PATCH] Table DIGITAL with all data and mappings --- definitions/staging/stg_DIGITAL.sqlx | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 definitions/staging/stg_DIGITAL.sqlx diff --git a/definitions/staging/stg_DIGITAL.sqlx b/definitions/staging/stg_DIGITAL.sqlx new file mode 100644 index 0000000..eaa29d9 --- /dev/null +++ b/definitions/staging/stg_DIGITAL.sqlx @@ -0,0 +1,46 @@ +config { + type: "table", + schema: "pphe_five9_stg", + assertions: { + uniqueKey: ["?"], + nonNull: ["?"] + }, + tags: ["daily"], + description: "DIGITAL data with mappings" +} + +select dl.TIMESTAMP, + dl.DATE, + dl.HOUR_OF_DAY, + dl.MONTH, + dl.YEAR, + dl.AGENT_ID, + dl.AGENT_NAME, + a.LANGUAGES, + a.CODE LANGUAUGE_ID, + a.AGENT_GROUP_ID, + dl.AGENT_GROUP, + d.DISPOSITION_ID, + dl.DISPOSITION, + dl.MEDIA_TYPE, + m.MEDIA_TYPE_ID, + c.CAMPAIGN_ID, + dl.CAMPAIGN, + c.CAMPAIGN_GROUP_ID, + c.CAMPAIGN_GROUP, + dl.SKILL, + s.SKILL_ID, + dl.HANDLE_TIME, + dl.TRANSFERS_TO_SKILL, + dl.INTERACTIONS +from ${ref("stg_DIGITAL_L30D")} dl +left join ${ref("stg_AGENT")} a +on dl.AGENT_ID = a.AGENT_ID +left join ${ref("stg_DISPOSITION")} d +on dl.DISPOSITION = d.DISPOSITION +left join ${ref("stg_CAMPAIGN")} c +on dl.CAMPAIGN = c.CAMPAIGN +left join ${ref("stg_MAPPING_SKILL")} s +on dl.SKILL = s.SKILL +left join ${ref("stg_MAPPING_MEDIA_TYPE")} m +on dl.MEDIA_TYPE = m.MEDIA_TYPE \ No newline at end of file