Compare commits
10 Commits
2aa8a4c278
...
a4a6c95cb6
| Author | SHA1 | Date | |
|---|---|---|---|
| a4a6c95cb6 | |||
| 582c52957d | |||
| e42a555b8c | |||
| 0c10d61456 | |||
| b795ed49fb | |||
| 6cdfc4295e | |||
| 7ed6bc8010 | |||
| ee267f4939 | |||
| 846c4f317b | |||
| bbc565bcf1 |
@ -1,9 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_gold",
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Exporting last 7 days of AGENT_STATUS table."
|
|
||||||
}
|
|
||||||
|
|
||||||
select *
|
|
||||||
from ${ref("stg_agent_status_report")}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_gold",
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Exporting last 7 days of CALLS table"
|
|
||||||
}
|
|
||||||
|
|
||||||
select *
|
|
||||||
from ${ref("stg_calls_report")}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_gold",
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Exporting last 7 days of DIGITAL table by end time."
|
|
||||||
}
|
|
||||||
|
|
||||||
select *
|
|
||||||
from ${ref("stg_closed_digital_report")}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_gold",
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Exporting last 7 days of DIGITAL table."
|
|
||||||
}
|
|
||||||
|
|
||||||
select *
|
|
||||||
from ${ref("stg_digital_report")}
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
config {
|
config {
|
||||||
type: "table",
|
type: "table",
|
||||||
|
schema: "pphe_five9_gold",
|
||||||
uniqueKey: ["AGENT_ID", "TIMESTAMP", "STATE"],
|
uniqueKey: ["AGENT_ID", "TIMESTAMP", "STATE"],
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
assertions: {
|
||||||
uniqueKey: ["AGENT_ID", "TIMESTAMP", "STATE"],
|
uniqueKey: ["AGENT_ID", "TIMESTAMP", "STATE"],
|
||||||
nonNull: ["AGENT_ID", "TIMESTAMP", "STATE"],
|
nonNull: ["AGENT_ID", "TIMESTAMP", "STATE"],
|
||||||
@ -15,7 +15,7 @@ config {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
tags: ["agent_status_report"],
|
tags: ["agent_status_report"],
|
||||||
description: "Main agent status data for report"
|
description: "Exporting last 7 days of AGENT_STATUS table."
|
||||||
}
|
}
|
||||||
|
|
||||||
--Extraction and transformation of fields that are used in Board load further. Contains last 7 days
|
--Extraction and transformation of fields that are used in Board load further. Contains last 7 days
|
||||||
@ -68,15 +68,15 @@ select ags.AGENT_ID,
|
|||||||
from ${ref("stg_agent_status")} ags
|
from ${ref("stg_agent_status")} ags
|
||||||
left join ${ref("stg_AGENT")} a
|
left join ${ref("stg_AGENT")} a
|
||||||
on ags.AGENT_ID = a.AGENT_ID
|
on ags.AGENT_ID = a.AGENT_ID
|
||||||
left join ${ref("stg_MAPPING_AGENT_STATE_ID")} mas
|
left join ${ref("MAPPING_AGENT_STATE_ID")} mas
|
||||||
on ags.STATE = mas.STATE
|
on ags.STATE = mas.STATE
|
||||||
left join ${ref("stg_MAPPING_AGENT_STATE_GROUP")} masgi
|
left join ${ref("MAPPING_AGENT_STATE_GROUP")} masgi
|
||||||
on mas.STATE_ID = masgi.STATE_ID
|
on mas.STATE_ID = masgi.STATE_ID
|
||||||
left join ${ref("stg_MAPPING_AGENT_STATE_GROUP_ID")} masg
|
left join ${ref("MAPPING_AGENT_STATE_GROUP_ID")} masg
|
||||||
on masgi.STATE_GROUP_ID = masg.STATE_GROUP_ID
|
on masgi.STATE_GROUP_ID = masg.STATE_GROUP_ID
|
||||||
left join ${ref("stg_MAPPING_AGENT_REASON_CODE_ID")} mrc
|
left join ${ref("MAPPING_AGENT_REASON_CODE_ID")} mrc
|
||||||
on ags.REASON_CODE = mrc.REASON_CODE
|
on ags.REASON_CODE = mrc.REASON_CODE
|
||||||
left join ${ref("stg_MAPPING_PRODUCTIVE_REVENUE")} mpr
|
left join ${ref("MAPPING_PRODUCTIVE_REVENUE")} mpr
|
||||||
on COALESCE(mas.STATE_ID, 0) = COALESCE(mpr.STATE_ID, 0)
|
on COALESCE(mas.STATE_ID, 0) = COALESCE(mpr.STATE_ID, 0)
|
||||||
and COALESCE(mrc.REASON_CODE_ID, 0) = COALESCE(mpr.REASON_CODE_ID, 0)
|
and COALESCE(mrc.REASON_CODE_ID, 0) = COALESCE(mpr.REASON_CODE_ID, 0)
|
||||||
where date(ags.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
where date(ags.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
||||||
@ -1,7 +1,7 @@
|
|||||||
config {
|
config {
|
||||||
type: "table",
|
type: "table",
|
||||||
|
schema: "pphe_five9_gold",
|
||||||
uniqueKey: ["SESSION_ID", "TIMESTAMP", "DNIS"],
|
uniqueKey: ["SESSION_ID", "TIMESTAMP", "DNIS"],
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
assertions: {
|
||||||
uniqueKey: ["SESSION_ID", "TIMESTAMP", "DNIS"],
|
uniqueKey: ["SESSION_ID", "TIMESTAMP", "DNIS"],
|
||||||
nonNull: ["SESSION_ID", "TIMESTAMP", "DNIS", "AGENT_GROUP_ID", "SKILL_ID"],
|
nonNull: ["SESSION_ID", "TIMESTAMP", "DNIS", "AGENT_GROUP_ID", "SKILL_ID"],
|
||||||
@ -16,7 +16,7 @@ config {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
tags: ["calls_report"],
|
tags: ["calls_report"],
|
||||||
description: "Main calls data for report"
|
description: "Exporting last 7 days of CALLS table"
|
||||||
}
|
}
|
||||||
|
|
||||||
--Extraction and transformation of fields that are used in Board load further. Contains last 7 days
|
--Extraction and transformation of fields that are used in Board load further. Contains last 7 days
|
||||||
@ -83,9 +83,9 @@ left join ${ref("stg_DISPOSITION")} d
|
|||||||
on sc.DISPOSITION = d.DISPOSITION
|
on sc.DISPOSITION = d.DISPOSITION
|
||||||
left join ${ref("stg_CAMPAIGN")} c
|
left join ${ref("stg_CAMPAIGN")} c
|
||||||
on sc.CAMPAIGN = c.CAMPAIGN
|
on sc.CAMPAIGN = c.CAMPAIGN
|
||||||
left join ${ref("stg_MAPPING_PROPERTY_CALLS")} p
|
left join ${ref("MAPPING_PROPERTY_CALLS")} p
|
||||||
on sc.Routing_Hotel_Name = p.ROUTING_HOTEL_NAME
|
on sc.Routing_Hotel_Name = p.ROUTING_HOTEL_NAME
|
||||||
left join ${ref("stg_MAPPING_SKILL")} s
|
left join ${ref("MAPPING_SKILL")} s
|
||||||
on sc.SKILL = s.SKILL
|
on sc.SKILL = s.SKILL
|
||||||
where date(sc.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
where date(sc.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
||||||
and date(sc.TIMESTAMP) < CURRENT_DATE()
|
and date(sc.TIMESTAMP) < CURRENT_DATE()
|
||||||
@ -1,9 +1,9 @@
|
|||||||
config {
|
config {
|
||||||
type: "table",
|
type: "table",
|
||||||
|
schema: "pphe_five9_gold",
|
||||||
uniqueKey: ["SESSION_GUID"],
|
uniqueKey: ["SESSION_GUID"],
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
tags: ["digital_report"],
|
tags: ["digital_report"],
|
||||||
description: "Main digital data for report by the end_time"
|
description: "Exporting last 7 days of DIGITAL table by end time."
|
||||||
}
|
}
|
||||||
|
|
||||||
--Extraction and transformation of fields that are used in Board load further. Contains last 7 days by the end time
|
--Extraction and transformation of fields that are used in Board load further. Contains last 7 days by the end time
|
||||||
@ -54,11 +54,11 @@ left join ${ref("stg_DISPOSITION")} dis
|
|||||||
on d.DISPOSITION = dis.DISPOSITION
|
on d.DISPOSITION = dis.DISPOSITION
|
||||||
left join ${ref("stg_CAMPAIGN")} c
|
left join ${ref("stg_CAMPAIGN")} c
|
||||||
on d.CAMPAIGN = c.CAMPAIGN
|
on d.CAMPAIGN = c.CAMPAIGN
|
||||||
left join ${ref("stg_MAPPING_PROPERTY_DIGITAL")} p
|
left join ${ref("MAPPING_PROPERTY_DIGITAL")} p
|
||||||
on c.CAMPAIGN_ID = p.CAMPAIGN_ID
|
on c.CAMPAIGN_ID = p.CAMPAIGN_ID
|
||||||
left join ${ref("stg_MAPPING_SKILL")} s
|
left join ${ref("MAPPING_SKILL")} s
|
||||||
on d.SKILL = s.SKILL
|
on d.SKILL = s.SKILL
|
||||||
left join ${ref("stg_MAPPING_MEDIA_TYPE")} m
|
left join ${ref("MAPPING_MEDIA_TYPE")} m
|
||||||
on d.MEDIA_TYPE = m.MEDIA_TYPE
|
on d.MEDIA_TYPE = m.MEDIA_TYPE
|
||||||
where date(d.END_TIME) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
where date(d.END_TIME) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
||||||
and date(d.END_TIME) < CURRENT_DATE()
|
and date(d.END_TIME) < CURRENT_DATE()
|
||||||
@ -1,7 +1,7 @@
|
|||||||
config {
|
config {
|
||||||
type: "table",
|
type: "table",
|
||||||
|
schema: "pphe_five9_gold",
|
||||||
uniqueKey: ["SESSION_GUID"],
|
uniqueKey: ["SESSION_GUID"],
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
assertions: {
|
||||||
uniqueKey: ["SESSION_GUID"],
|
uniqueKey: ["SESSION_GUID"],
|
||||||
nonNull: ["SESSION_GUID", "AGENT_GROUP_ID", "MEDIA_TYPE_ID", "SKILL_ID"],
|
nonNull: ["SESSION_GUID", "AGENT_GROUP_ID", "MEDIA_TYPE_ID", "SKILL_ID"],
|
||||||
@ -15,7 +15,7 @@ config {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
tags: ["digital_report"],
|
tags: ["digital_report"],
|
||||||
description: "Main digital data for report"
|
description: "Exporting last 7 days of DIGITAL table."
|
||||||
}
|
}
|
||||||
|
|
||||||
--Extraction and transformation of fields that are used in Board load further. Contains last 7 days
|
--Extraction and transformation of fields that are used in Board load further. Contains last 7 days
|
||||||
@ -66,11 +66,11 @@ left join ${ref("stg_DISPOSITION")} dis
|
|||||||
on d.DISPOSITION = dis.DISPOSITION
|
on d.DISPOSITION = dis.DISPOSITION
|
||||||
left join ${ref("stg_CAMPAIGN")} c
|
left join ${ref("stg_CAMPAIGN")} c
|
||||||
on d.CAMPAIGN = c.CAMPAIGN
|
on d.CAMPAIGN = c.CAMPAIGN
|
||||||
left join ${ref("stg_MAPPING_PROPERTY_DIGITAL")} p
|
left join ${ref("MAPPING_PROPERTY_DIGITAL")} p
|
||||||
on c.CAMPAIGN_ID = p.CAMPAIGN_ID
|
on c.CAMPAIGN_ID = p.CAMPAIGN_ID
|
||||||
left join ${ref("stg_MAPPING_SKILL")} s
|
left join ${ref("MAPPING_SKILL")} s
|
||||||
on d.SKILL = s.SKILL
|
on d.SKILL = s.SKILL
|
||||||
left join ${ref("stg_MAPPING_MEDIA_TYPE")} m
|
left join ${ref("MAPPING_MEDIA_TYPE")} m
|
||||||
on d.MEDIA_TYPE = m.MEDIA_TYPE
|
on d.MEDIA_TYPE = m.MEDIA_TYPE
|
||||||
where date(d.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
where date(d.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
||||||
and date(d.TIMESTAMP) < CURRENT_DATE()
|
and date(d.TIMESTAMP) < CURRENT_DATE()
|
||||||
6
definitions/sources/MAPPING_DEPARTMENT.sqlx
Normal file
6
definitions/sources/MAPPING_DEPARTMENT.sqlx
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
config {
|
||||||
|
type: "declaration",
|
||||||
|
schema: "pphe_five9_raw",
|
||||||
|
name: "MAPPING_DEPARTMENT",
|
||||||
|
description: ""
|
||||||
|
}
|
||||||
6
definitions/sources/MAPPING_SKILL_DEP.sqlx
Normal file
6
definitions/sources/MAPPING_SKILL_DEP.sqlx
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
config {
|
||||||
|
type: "declaration",
|
||||||
|
schema: "pphe_five9_raw",
|
||||||
|
name: "MAPPING_SKILL_DEP",
|
||||||
|
description: ""
|
||||||
|
}
|
||||||
@ -5,7 +5,7 @@ config {
|
|||||||
uniqueKey: ["AGENT_ID"],
|
uniqueKey: ["AGENT_ID"],
|
||||||
nonNull: ["AGENT_ID"]
|
nonNull: ["AGENT_ID"]
|
||||||
},
|
},
|
||||||
tags: ["on-demand"],
|
tags: ["daily"],
|
||||||
description: "All fields that are connected to the AGENT"
|
description: "All fields that are connected to the AGENT"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,8 +117,8 @@ select all_agents_dedup.AGENT_ID,
|
|||||||
all_agents_dedup.AGENT_GROUP,
|
all_agents_dedup.AGENT_GROUP,
|
||||||
ag.AGENT_GROUP_ID
|
ag.AGENT_GROUP_ID
|
||||||
from all_agents_dedup
|
from all_agents_dedup
|
||||||
left join ${ref("stg_MAPPING_AGENT_GROUP")} ag
|
left join ${ref("MAPPING_AGENT_GROUP")} ag
|
||||||
on all_agents_dedup.AGENT_GROUP = ag.AGENT_GROUP
|
on all_agents_dedup.AGENT_GROUP = ag.AGENT_GROUP
|
||||||
left join ${ref("stg_MAPPING_LANGUAGES")} ml
|
left join ${ref("MAPPING_LANGUAGES")} ml
|
||||||
on upper(all_agents_dedup.LANGUAGES) = upper(ml.LANGUAGE)
|
on upper(all_agents_dedup.LANGUAGES) = upper(ml.LANGUAGE)
|
||||||
where row_n = 1
|
where row_n = 1
|
||||||
@ -1,5 +1,5 @@
|
|||||||
config {
|
config {
|
||||||
type: "view",
|
type: "table",
|
||||||
schema: "pphe_five9_stg",
|
schema: "pphe_five9_stg",
|
||||||
tags: ["daily"],
|
tags: ["daily"],
|
||||||
description: "All fields that are connected to the CAMPAIGN"
|
description: "All fields that are connected to the CAMPAIGN"
|
||||||
@ -11,12 +11,12 @@ select c.CAMPAIGN,
|
|||||||
cgi.CAMPAIGN_GROUP,
|
cgi.CAMPAIGN_GROUP,
|
||||||
cit.CAMPAIGN_TYPE_ID,
|
cit.CAMPAIGN_TYPE_ID,
|
||||||
ct.CAMPAIGN_TYPE
|
ct.CAMPAIGN_TYPE
|
||||||
from ${ref("stg_MAPPING_CAMPAIGN")} c
|
from ${ref("MAPPING_CAMPAIGN")} c
|
||||||
left join ${ref("stg_MAPPING_CAMPAIGN_GROUP")} cg
|
left join ${ref("MAPPING_CAMPAIGN_GROUP")} cg
|
||||||
on c.CAMPAIGN_ID = cg.CAMPAIGN_ID
|
on c.CAMPAIGN_ID = cg.CAMPAIGN_ID
|
||||||
left join ${ref("stg_MAPPING_CAMPAIGN_GROUP_ID")} cgi
|
left join ${ref("MAPPING_CAMPAIGN_GROUP_ID")} cgi
|
||||||
on cg.campaign_group_id = cgi.campaign_group_id
|
on cg.campaign_group_id = cgi.campaign_group_id
|
||||||
left join ${ref("stg_MAPPING_CAMPAIGN_ID_TYPE")} cit
|
left join ${ref("MAPPING_CAMPAIGN_ID_TYPE")} cit
|
||||||
on c.CAMPAIGN_ID = cit.CAMPAIGN_ID
|
on c.CAMPAIGN_ID = cit.CAMPAIGN_ID
|
||||||
left join ${ref("stg_MAPPING_CAMPAIGN_TYPE")} ct
|
left join ${ref("MAPPING_CAMPAIGN_TYPE")} ct
|
||||||
on ct.CAMPAIGN_TYPE_ID = cit.CAMPAIGN_TYPE_ID
|
on ct.CAMPAIGN_TYPE_ID = cit.CAMPAIGN_TYPE_ID
|
||||||
@ -1,5 +1,5 @@
|
|||||||
config {
|
config {
|
||||||
type: "view",
|
type: "table",
|
||||||
schema: "pphe_five9_stg",
|
schema: "pphe_five9_stg",
|
||||||
tags: ["daily"],
|
tags: ["daily"],
|
||||||
description: "All fields that are connected to the DISPOSITION"
|
description: "All fields that are connected to the DISPOSITION"
|
||||||
@ -9,8 +9,8 @@ select d.DISPOSITION,
|
|||||||
d.DISPOSITION_ID,
|
d.DISPOSITION_ID,
|
||||||
di.DISPOSITION_GROUP_ID,
|
di.DISPOSITION_GROUP_ID,
|
||||||
dg.DISPOSITION_GROUP
|
dg.DISPOSITION_GROUP
|
||||||
from ${ref("stg_MAPPING_DISPOSITION_ID")} d
|
from ${ref("MAPPING_DISPOSITION_ID")} d
|
||||||
left join ${ref("stg_MAPPING_DISPOSITION_ID_GROUP")} di
|
left join ${ref("MAPPING_DISPOSITION_ID_GROUP")} di
|
||||||
on d.DISPOSITION_ID = di.DISPOSITION_ID
|
on d.DISPOSITION_ID = di.DISPOSITION_ID
|
||||||
left join ${ref("stg_MAPPING_DISPOSITION_GROUP_ID")} dg
|
left join ${ref("MAPPING_DISPOSITION_GROUP_ID")} dg
|
||||||
on di.DISPOSITION_GROUP_ID = dg.DISPOSITION_GROUP_ID
|
on di.DISPOSITION_GROUP_ID = dg.DISPOSITION_GROUP_ID
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["AGENT_GROUP_ID"],
|
|
||||||
nonNull: ["AGENT_GROUP_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_AGENT_GROUP table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_AGENT_GROUP")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["REASON_CODE_ID"],
|
|
||||||
nonNull: ["REASON_CODE_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_AGENT_REASON_CODE_ID table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_AGENT_REASON_CODE_ID")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["STATE_ID"],
|
|
||||||
nonNull: ["STATE_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_STATE_AGENT_GROUP table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_AGENT_STATE_GROUP")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["STATE_GROUP_ID"],
|
|
||||||
nonNull: ["STATE_GROUP_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_STATE_AGENT_GROUP_ID table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_AGENT_STATE_GROUP_ID")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["STATE_ID"],
|
|
||||||
nonNull: ["STATE_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_AGENT_STATE_ID table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_AGENT_STATE_ID")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["CAMPAIGN_ID"],
|
|
||||||
nonNull: ["CAMPAIGN_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_CAMPAIGN table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_CAMPAIGN")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["CAMPAIGN_ID"],
|
|
||||||
nonNull: ["CAMPAIGN_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_CAMPAIGN_GROUP table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_CAMPAIGN_GROUP")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["CAMPAIGN_GROUP_ID"],
|
|
||||||
nonNull: ["CAMPAIGN_GROUP_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_CAMPAIGN_GROUP_ID table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_CAMPAIGN_GROUP_ID")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["CAMPAIGN_ID"],
|
|
||||||
nonNull: ["CAMPAIGN_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_CAMPAIGN_ID_TYPE table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_CAMPAIGN_ID_TYPE")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["CAMPAIGN_TYPE_ID"],
|
|
||||||
nonNull: ["CAMPAIGN_TYPE_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_CAMPAIGN_TYPE table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_CAMPAIGN_TYPE")}
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_CSC_AGENT table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_CSC_AGENT")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["DISPOSITION_GROUP_ID"],
|
|
||||||
nonNull: ["DISPOSITION_GROUP_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_DISPOSITION_GROUP_ID table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_DISPOSITION_GROUP_ID")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["DISPOSITION_ID"],
|
|
||||||
nonNull: ["DISPOSITION_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_DISPOSITION_ID table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_DISPOSITION_ID")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["DISPOSITION_ID"],
|
|
||||||
nonNull: ["DISPOSITION_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_DISPOSITION_ID_GROUP table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_DISPOSITION_ID_GROUP")}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["LANGUAGE"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_LANGUAGES table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_LANGUAGES")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["MEDIA_TYPE_ID"],
|
|
||||||
nonNull: ["MEDIA_TYPE_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_MEDIA_TYPE table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_MEDIA_TYPE")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["STATE_ID", "REASON_CODE_ID"],
|
|
||||||
nonNull: ["STATE_ID", "REASON_CODE_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_PRODUCTIVE_REVENUE table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_PRODUCTIVE_REVENUE")}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
nonNull: ["BOARD_PROPERTY_GROUP"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_PROPERTY_CALLS table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_PROPERTY_CALLS")}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
nonNull: ["BOARD_PROPERTY_GROUP"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_PROPERTY_DIGITAL table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_PROPERTY_DIGITAL")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["RESV_STATUS_ID"],
|
|
||||||
nonNull: ["RESV_STATUS_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_RESV_STATUS table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_RESV_STATUS")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["SKILL_ID"],
|
|
||||||
nonNull: ["SKILL_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_SKILL table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_SKILL")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["UPDATE_TYPE_ID"],
|
|
||||||
nonNull: ["UPDATE_TYPE_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_UPDATE_TYPE table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_UPDATE_TYPE")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["UPDATE_TYPE_ID"],
|
|
||||||
nonNull: ["UPDATE_TYPE_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_UPDATE_TYPE_GROUP table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_UPDATE_TYPE_GROUP")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["UPDATE_TYPE_GROUP"],
|
|
||||||
nonNull: ["UPDATE_TYPE_GROUP"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_UPDATE_TYPE_GROUP_ID table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_UPDATE_TYPE_GROUP_ID")}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
config {
|
|
||||||
type: "table",
|
|
||||||
schema: "pphe_five9_stg",
|
|
||||||
assertions: {
|
|
||||||
uniqueKey: ["UPDATE_TYPE_ID"],
|
|
||||||
nonNull: ["UPDATE_TYPE_ID"]
|
|
||||||
},
|
|
||||||
tags: ["daily"],
|
|
||||||
description: "Daily load of MAPPING_UPDATE_TYPE_REVENUE table from raw"
|
|
||||||
}
|
|
||||||
|
|
||||||
select
|
|
||||||
*
|
|
||||||
from ${ref("MAPPING_UPDATE_TYPE_REVENUE")}
|
|
||||||
16
definitions/staging/stg_SKILL.sqlx
Normal file
16
definitions/staging/stg_SKILL.sqlx
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
config {
|
||||||
|
type: "table",
|
||||||
|
schema: "pphe_five9_stg",
|
||||||
|
tags: ["daily"],
|
||||||
|
description: "All fields that are connected to the SKILL"
|
||||||
|
}
|
||||||
|
|
||||||
|
select s.SKILL,
|
||||||
|
s.SKILL_ID,
|
||||||
|
sd.DEPARTMENT_ID,
|
||||||
|
d.DEPARTMENT,
|
||||||
|
from ${ref("MAPPING_SKILL")} s
|
||||||
|
left join ${ref("MAPPING_SKILL_DEP")} sd
|
||||||
|
on s.SKILL_ID = sd.SKILL_ID
|
||||||
|
left join ${ref("MAPPING_DEPARTMENT")} d
|
||||||
|
on sd.DEPARTMENT_ID = d.DEPARTMENT_ID
|
||||||
@ -68,15 +68,15 @@ select ags.AGENT_ID,
|
|||||||
from ${ref("stg_agent_status")} ags
|
from ${ref("stg_agent_status")} ags
|
||||||
left join ${ref("stg_AGENT")} a
|
left join ${ref("stg_AGENT")} a
|
||||||
on ags.AGENT_ID = a.AGENT_ID
|
on ags.AGENT_ID = a.AGENT_ID
|
||||||
left join ${ref("stg_MAPPING_AGENT_STATE_ID")} mas
|
left join ${ref("MAPPING_AGENT_STATE_ID")} mas
|
||||||
on ags.STATE = mas.STATE
|
on ags.STATE = mas.STATE
|
||||||
left join ${ref("stg_MAPPING_AGENT_STATE_GROUP")} masgi
|
left join ${ref("MAPPING_AGENT_STATE_GROUP")} masgi
|
||||||
on mas.STATE_ID = masgi.STATE_ID
|
on mas.STATE_ID = masgi.STATE_ID
|
||||||
left join ${ref("stg_MAPPING_AGENT_STATE_GROUP_ID")} masg
|
left join ${ref("MAPPING_AGENT_STATE_GROUP_ID")} masg
|
||||||
on masgi.STATE_GROUP_ID = masg.STATE_GROUP_ID
|
on masgi.STATE_GROUP_ID = masg.STATE_GROUP_ID
|
||||||
left join ${ref("stg_MAPPING_AGENT_REASON_CODE_ID")} mrc
|
left join ${ref("MAPPING_AGENT_REASON_CODE_ID")} mrc
|
||||||
on ags.REASON_CODE = mrc.REASON_CODE
|
on ags.REASON_CODE = mrc.REASON_CODE
|
||||||
left join ${ref("stg_MAPPING_PRODUCTIVE_REVENUE")} mpr
|
left join ${ref("MAPPING_PRODUCTIVE_REVENUE")} mpr
|
||||||
on COALESCE(mas.STATE_ID, 0) = COALESCE(mpr.STATE_ID, 0)
|
on COALESCE(mas.STATE_ID, 0) = COALESCE(mpr.STATE_ID, 0)
|
||||||
and COALESCE(mrc.REASON_CODE_ID, 0) = COALESCE(mpr.REASON_CODE_ID, 0)
|
and COALESCE(mrc.REASON_CODE_ID, 0) = COALESCE(mpr.REASON_CODE_ID, 0)
|
||||||
where ags.STATE not in ('Login', 'Logout', 'On Park', 'On Preview', 'On Video', 'On Voicemail')
|
where ags.STATE not in ('Login', 'Logout', 'On Park', 'On Preview', 'On Video', 'On Voicemail')
|
||||||
|
|||||||
@ -84,9 +84,9 @@ left join ${ref("stg_DISPOSITION")} d
|
|||||||
on sc.DISPOSITION = d.DISPOSITION
|
on sc.DISPOSITION = d.DISPOSITION
|
||||||
left join ${ref("stg_CAMPAIGN")} c
|
left join ${ref("stg_CAMPAIGN")} c
|
||||||
on sc.CAMPAIGN = c.CAMPAIGN
|
on sc.CAMPAIGN = c.CAMPAIGN
|
||||||
left join ${ref("stg_MAPPING_PROPERTY_CALLS")} p
|
left join ${ref("MAPPING_PROPERTY_CALLS")} p
|
||||||
on sc.Routing_Hotel_Name = p.ROUTING_HOTEL_NAME
|
on sc.Routing_Hotel_Name = p.ROUTING_HOTEL_NAME
|
||||||
left join ${ref("stg_MAPPING_SKILL")} s
|
left join ${ref("MAPPING_SKILL")} s
|
||||||
on sc.SKILL = s.SKILL
|
on sc.SKILL = s.SKILL
|
||||||
${ when(incremental(), `where date(sc.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
${ when(incremental(), `where date(sc.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
||||||
and date(sc.TIMESTAMP) < CURRENT_DATE()`) }
|
and date(sc.TIMESTAMP) < CURRENT_DATE()`) }
|
||||||
@ -52,17 +52,17 @@ csc_agent as (
|
|||||||
1 as COUNTER,
|
1 as COUNTER,
|
||||||
cr.UPDATE_DESCRIPTION
|
cr.UPDATE_DESCRIPTION
|
||||||
from csc_rev_deduplicated cr
|
from csc_rev_deduplicated cr
|
||||||
left join ${ref("pphe_five9_stg","stg_MAPPING_CSC_AGENT")} ca
|
left join ${ref("MAPPING_CSC_AGENT")} ca
|
||||||
on cr.UPDATE_USER=ca.OPERA_UPDATE_USER
|
on cr.UPDATE_USER=ca.OPERA_UPDATE_USER
|
||||||
left join ${ref("pphe_five9_stg","stg_MAPPING_RESV_STATUS")} ms
|
left join ${ref("MAPPING_RESV_STATUS")} ms
|
||||||
on cr.RESV_STATUS=ms.RESV_STATUS
|
on cr.RESV_STATUS=ms.RESV_STATUS
|
||||||
left join ${ref("pphe_five9_stg","stg_MAPPING_UPDATE_TYPE")} mu
|
left join ${ref("MAPPING_UPDATE_TYPE")} mu
|
||||||
on cr.UPDATE_TYPE=mu.UPDATE_TYPE
|
on cr.UPDATE_TYPE=mu.UPDATE_TYPE
|
||||||
left join ${ref("pphe_five9_stg","stg_MAPPING_UPDATE_TYPE_GROUP")} mug
|
left join ${ref("MAPPING_UPDATE_TYPE_GROUP")} mug
|
||||||
on mu.UPDATE_TYPE_ID=mug.UPDATE_TYPE_ID
|
on mu.UPDATE_TYPE_ID=mug.UPDATE_TYPE_ID
|
||||||
left join ${ref("pphe_five9_stg","stg_MAPPING_UPDATE_TYPE_GROUP_ID")} mugi
|
left join ${ref("MAPPING_UPDATE_TYPE_GROUP_ID")} mugi
|
||||||
on mug.UPDATE_TYPE_GROUP_ID=mugi.UPDATE_TYPE_GROUP_ID
|
on mug.UPDATE_TYPE_GROUP_ID=mugi.UPDATE_TYPE_GROUP_ID
|
||||||
left join ${ref("pphe_five9_stg","stg_MAPPING_UPDATE_TYPE_REVENUE")} mur
|
left join ${ref("MAPPING_UPDATE_TYPE_REVENUE")} mur
|
||||||
on mu.UPDATE_TYPE_ID=mur.UPDATE_TYPE_ID
|
on mu.UPDATE_TYPE_ID=mur.UPDATE_TYPE_ID
|
||||||
where row_number = 1
|
where row_number = 1
|
||||||
and cr.UPDATE_USER is not null
|
and cr.UPDATE_USER is not null
|
||||||
|
|||||||
@ -67,11 +67,11 @@ left join ${ref("stg_DISPOSITION")} dis
|
|||||||
on d.DISPOSITION = dis.DISPOSITION
|
on d.DISPOSITION = dis.DISPOSITION
|
||||||
left join ${ref("stg_CAMPAIGN")} c
|
left join ${ref("stg_CAMPAIGN")} c
|
||||||
on d.CAMPAIGN = c.CAMPAIGN
|
on d.CAMPAIGN = c.CAMPAIGN
|
||||||
left join ${ref("stg_MAPPING_PROPERTY_DIGITAL")} p
|
left join ${ref("MAPPING_PROPERTY_DIGITAL")} p
|
||||||
on c.CAMPAIGN_ID = p.CAMPAIGN_ID
|
on c.CAMPAIGN_ID = p.CAMPAIGN_ID
|
||||||
left join ${ref("stg_MAPPING_SKILL")} s
|
left join ${ref("MAPPING_SKILL")} s
|
||||||
on d.SKILL = s.SKILL
|
on d.SKILL = s.SKILL
|
||||||
left join ${ref("stg_MAPPING_MEDIA_TYPE")} m
|
left join ${ref("MAPPING_MEDIA_TYPE")} m
|
||||||
on d.MEDIA_TYPE = m.MEDIA_TYPE
|
on d.MEDIA_TYPE = m.MEDIA_TYPE
|
||||||
${ when(incremental(), `where date(d.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
${ when(incremental(), `where date(d.TIMESTAMP) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)
|
||||||
and date(d.TIMESTAMP) < CURRENT_DATE()`) }
|
and date(d.TIMESTAMP) < CURRENT_DATE()`) }
|
||||||
Loading…
Reference in New Issue
Block a user