30 lines
703 B
Plaintext
30 lines
703 B
Plaintext
config {
|
|
type: "table",
|
|
schema: "pphe_five9_gold",
|
|
assertions: {
|
|
uniqueKey: ["?"],
|
|
nonNull: ["?"]
|
|
},
|
|
tags: ["daily"],
|
|
description: "All interactions table for CALLS and DIGITAL"
|
|
}
|
|
|
|
select TIMESTAMP,
|
|
replace(safe_cast(safe_cast(cl.DATE as date) as string), '-', '') DATE,
|
|
HOUR_OF_DAY,
|
|
MONTH,
|
|
YEAR,
|
|
AGENT_ID,
|
|
'PHONE' MEDIA_TYPE_ID,
|
|
1 INTERACTIONS
|
|
from ${ref("CALLS")}
|
|
union all
|
|
select TIMESTAMP,
|
|
replace(safe_cast(safe_cast(cl.DATE as date) as string), '-', '') DATE,
|
|
HOUR_OF_DAY,
|
|
MONTH,
|
|
YEAR,
|
|
AGENT_ID,
|
|
MEDIA_TYPE_ID,
|
|
INTERACTIONS
|
|
from ${ref("DIGITAL")} |