See Callummary : View for call summary data with aggregated metrics
CREATE VIEW vwcallsummary AS (
SELECT di.conversationid AS "Fact.ConversationId",
qd.name AS "Fact.QueueName",
di.conversationstartdate AS "Date.ConversationStartDate",
di.conversationenddate AS "Date.ConversationEndDate",
di.ani AS "Fact.ANI",
di.dnis AS "Fact.DNIS",
di.originaldirection AS "Fact.OriginalDirection",
sum(di.ttalkcomplete) AS "Raw.Talk",
sum(di.tacw) AS "Raw.ACW",
sum(di.theldcomplete) AS "Raw.Hold",
sum(di.tvoicemail) AS "Raw.Voicemail",
sum(di.ntransferred) AS "Count.Transferred",
sum(di.tabandon) AS "Raw.Abandon",
(sum(di.ttalkcomplete) / 86400.00) AS "Raw.TalkDay",
(sum(di.tacw) / 86400.00) AS "Raw.ACWDay",
(sum(di.theldcomplete) / 86400.00) AS "Raw.HoldDay",
(sum(di.tvoicemail) / 86400.00) AS "Raw.VoicemailDay",
((sum(di.ntransferred))::numeric / 86400.00) AS "Count.TransferredDay",
(sum(di.tabandon) / 86400.00) AS "Raw.AbandonDay"
FROM (detailedinteractiondata di
LEFT JOIN queuedetails qd ON (((qd.id)::text = (di.queueid)::text)))
GROUP BY di.conversationid, qd.name, di.conversationstartdate, di.conversationenddate, di.ani, di.dnis, di.originaldirection
)
Name | Type | Default | Nullable | Children | Parents | Comment |
---|---|---|---|---|---|---|
Fact.ConversationId | varchar(50) | true | Fact: Conversation GUID | |||
Fact.QueueName | varchar(255) | true | Fact: Queue Name | |||
Date.ConversationStartDate | timestamp without time zone | true | Date: Conversation Start Date | |||
Date.ConversationEndDate | timestamp without time zone | true | Date: Conversation End Date | |||
Fact.ANI | varchar(400) | true | Fact: ANI | |||
Fact.DNIS | varchar(400) | true | Fact: DNIS | |||
Fact.OriginalDirection | varchar(50) | true | Fact: Original Direction | |||
Raw.Talk | numeric | true | Raw: Talk Time | |||
Raw.ACW | numeric | true | Raw: After Call Work Time | |||
Raw.Hold | numeric | true | Raw: Hold Time | |||
Raw.Voicemail | numeric | true | Raw: Voicemail Time | |||
Count.Transferred | bigint | true | Count: Transferred | |||
Raw.Abandon | numeric | true | Raw: Abandon Time | |||
Raw.TalkDay | numeric | true | Raw: Talk Time per Day | |||
Raw.ACWDay | numeric | true | Raw: After Call Work Time per Day | |||
Raw.HoldDay | numeric | true | Raw: Hold Time per Day | |||
Raw.VoicemailDay | numeric | true | Raw: Voicemail Time per Day | |||
Count.TransferredDay | numeric | true | Count: Transferred per Day | |||
Raw.AbandonDay | numeric | true | Raw: Abandon Time per Day |
Name | Columns | Comment | Type |
---|---|---|---|
public.detailedinteractiondata | 101 | Conversation Detailed Data | BASE TABLE |
public.queuedetails | 17 | Queue Lookup data | BASE TABLE |