Table CALLS with all the data and mappings
This commit is contained in:
parent
2e8d13501a
commit
643381901f
56
definitions/staging/stg_CALLS.sqlx
Normal file
56
definitions/staging/stg_CALLS.sqlx
Normal file
@ -0,0 +1,56 @@
|
||||
config {
|
||||
type: "table",
|
||||
schema: "pphe_five9_stg",
|
||||
assertions: {
|
||||
uniqueKey: ["CALL_ID"],
|
||||
nonNull: ["CALL_ID"]
|
||||
},
|
||||
tags: ["daily"],
|
||||
description: "CALLS data with mappings"
|
||||
}
|
||||
|
||||
select cl.TIMESTAMP,
|
||||
cl.DATE,
|
||||
cl.HOUR_OF_DAY,
|
||||
cl.DAY_OF_WEEK,
|
||||
cl.MONTH,
|
||||
cl.YEAR,
|
||||
cl.CALL_ID,
|
||||
cl.HOTEL_NAME,
|
||||
cl.AGENT_ID,
|
||||
cl.AGENT_NAME,
|
||||
a.LANGUAGES,
|
||||
a.CODE LANGUAUGE_ID,
|
||||
a.AGENT_GROUP_ID,
|
||||
cl.AGENT_GROUP,
|
||||
d.DISPOSITION_ID,
|
||||
cl.DISPOSITION,
|
||||
d.DISPOSITION_GROUP_ID,
|
||||
d.DISPOSITION_GROUP,
|
||||
c.CAMPAIGN_ID,
|
||||
cl.CAMPAIGN,
|
||||
c.CAMPAIGN_GROUP_ID,
|
||||
c.CAMPAIGN_GROUP,
|
||||
cl.SKILL,
|
||||
s.SKILL_ID,
|
||||
cl.CALL_TIME,
|
||||
cl.RING_TIME,
|
||||
cl.TALK_TIME,
|
||||
cl.SPEED_OF_ANSWER,
|
||||
cl.AFTER_CALL_WORK_TIME,
|
||||
cl.CALLS,
|
||||
cl.ANI,
|
||||
c.CAMPAIGN_TYPE_ID,
|
||||
cl.CAMPAIGN_TYPE,
|
||||
cl.DISPOSITION_GROUP_A,
|
||||
cl.DISPOSITION_GROUP_B,
|
||||
cl.DISPOSITION_GROUP_C,
|
||||
from ${ref("stg_CALL_L30D")} cl
|
||||
left join ${ref("stg_AGENT")} a
|
||||
on cl.AGENT_ID = a.AGENT_ID
|
||||
left join ${ref("stg_DISPOSITION")} d
|
||||
on cl.DISPOSITION = d.DISPOSITION
|
||||
left join ${ref("stg_CAMPAIGN")} c
|
||||
on cl.CAMPAIGN = c.CAMPAIGN
|
||||
left join ${ref("stg_MAPPING_SKILL")} s
|
||||
on cl.SKILL = s.SKILL
|
||||
Loading…
Reference in New Issue
Block a user