public.vwrealtimequeue

public.vwrealtimequeue

Description

Real-time queue data

Table Definition

CREATE VIEW vwrealtimequeue AS (
 SELECT qd.id AS queueid,
    qd.name AS queuename,
    qd.divisionid,
    qd.divisionname,
    qr.media,
    COALESCE(qr.conversationstate, ''::character varying) AS conversationstate,
    sum(
        CASE
            WHEN ((qr.actingas)::text = 'acd'::text) THEN 1
            ELSE 0
        END) AS acd_count,
    sum(
        CASE
            WHEN ((qr.actingas)::text = 'agent'::text) THEN 1
            ELSE 0
        END) AS interacting,
    COALESCE(min(
        CASE
            WHEN ((qr.actingas)::text = 'acd'::text) THEN qr.startdate
            ELSE NULL::timestamp without time zone
        END)) AS startdate,
    COALESCE(min(
        CASE
            WHEN ((qr.actingas)::text = 'acd'::text) THEN qr.startdateltc
            ELSE NULL::timestamp without time zone
        END)) AS startdateltc,
    datediff('second'::character varying, min(
        CASE
            WHEN ((qr.actingas)::text = 'acd'::text) THEN qr.startdate
            ELSE NULL::timestamp without time zone
        END), timezone('utc'::text, now())) AS statussecs,
    ((datediff('second'::character varying, min(
        CASE
            WHEN ((qr.actingas)::text = 'acd'::text) THEN qr.startdate
            ELSE NULL::timestamp without time zone
        END), timezone('utc'::text, now())))::numeric / 86400.00) AS statusdays,
    max(qr.updated) AS updated
   FROM (vwqueuedetails qd
     LEFT JOIN queuerealtimeconvdata qr ON (((qr.queueid)::text = (qd.id)::text)))
  GROUP BY qd.id, qd.name, qd.divisionid, qd.divisionname, qr.media, qr.conversationstate
  ORDER BY qd.name
)

Columns

Name Type Default Nullable Children Parents Comment
queueid varchar(50) true Queue GUID
queuename varchar(255) true Queue name
divisionid varchar(50) true Division ID
divisionname varchar(50) true Division name
media varchar(50) true Type of media (voice, chat, email, etc.)
conversationstate varchar true
acd_count bigint true Count of interactions with actingas = acd
interacting bigint true Total count of interactions currently being handled by agents
startdate timestamp without time zone true Start date of the interaction filtered to acd
startdateltc timestamp without time zone true Logical timestamp counter for start date filtered to acd
statussecs integer true Status duration in seconds calculated with DATEDIFF
statusdays numeric true Status duration in days calculated with DATEDIFF
updated timestamp without time zone true Timestamp of the last update

Referenced Tables

Name Columns Comment Type
public.vwqueuedetails 24 See QueueDetails: Queue Lookup data VIEW
public.queuerealtimeconvdata 32 BASE TABLE

    • Related Articles

    • public.vwrealtimequeueconv

      Description Real-time queue conversation data Table Definition CREATE VIEW vwrealtimequeueconv AS ( SELECT qc.conversationid, qc.media, qc.actingas, datediff('second'::character varying, qc.startdate, timezone('utc'::text, now())) AS statussecs, ...
    • public.participantattributesdynamic

      Description Columns Name Type Default Nullable Children Parents Comment keyid varchar(50) false conversationid varchar(50) false conversationstartdate timestamp without time zone false conversationstartdateltc timestamp without time zone true ...
    • public.evalquestiondata

      Description Columns Name Type Default Nullable Children Parents Comment keyid varchar(50) false evaluationid varchar(50) false evaluationformid varchar(50) false questiongroupid varchar(50) true questionid varchar(50) true answerid varchar(50) true ...
    • public.userpresencedetaileddata

      Description User Presence Detailed Data Columns Name Type Default Nullable Children Parents Comment keyid varchar(255) false Primary Key userid varchar(50) true Agent GUID starttime timestamp without time zone false Start Time (UTC) starttimeltc ...
    • public.userinteractionpresencedetaileddata

      Description Columns Name Type Default Nullable Children Parents Comment keyid varchar(255) false userid varchar(50) true starttime timestamp without time zone false starttimeltc timestamp without time zone true endtime timestamp without time zone ...