public.vwuserpresencedatadaily

public.vwuserpresencedatadaily

Description

See UserPresenceDataDaily - Expands all the GUIDs with their lookups(Daily)

Table Definition

CREATE VIEW vwuserpresencedatadaily AS (
 SELECT userpresencedatadaily.id,
    userpresencedatadaily.userid,
    userdetail.name AS agentname,
    userdetail.managerid,
    userdetail.managername,
    userdetail.divisionid,
    dd.name AS division_name,
    userpresencedatadaily.startdate,
    (userpresencedatadaily.startdate + ((( SELECT timezonecalcs.diff
           FROM timezonecalcs('Australia/Sydney'::text) timezonecalcs(utctime, ltctime, diff, timezonechosen)))::double precision * '00:00:01'::interval)) AS startdateusrtz,
    userpresencedatadaily.timetype,
    userpresencedatadaily.systempresenceid,
        CASE
            WHEN ((userpresencedatadaily.systempresenceid)::text ~ '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'::text) THEN presencedetails.systempresence
            ELSE userpresencedatadaily.systempresenceid
        END AS systempresencename,
    userpresencedatadaily.presenceid,
        CASE userpresencedatadaily.timetype
            WHEN 'Presence'::text THEN userpresencedatadaily.presencetime
            ELSE (0)::numeric
        END AS presencetime,
    (userpresencedatadaily.presencetime / 86400.00) AS presencetimeday,
    userpresencedatadaily.routingid,
        CASE userpresencedatadaily.timetype
            WHEN 'Routing'::text THEN userpresencedatadaily.presencetime
            ELSE (0)::numeric
        END AS routingtime,
    (userpresencedatadaily.routingtime / 86400.00) AS routingtimeday,
    userpresencedatadaily.updated
   FROM (((userpresencedatadaily userpresencedatadaily
     LEFT JOIN vwuserdetail userdetail ON (((userdetail.id)::text = (userpresencedatadaily.userid)::text)))
     LEFT JOIN divisiondetails dd ON (((dd.id)::text = (userdetail.divisionid)::text)))
     LEFT JOIN presencedetails ON (((presencedetails.id)::text = (userpresencedatadaily.systempresenceid)::text)))
)

Columns

Name Type Default Nullable Children Parents Comment
id varchar(50) true Primary key
userid varchar(50) true User GUID
agentname varchar(200) true Agent Name
managerid varchar(50) true Manager GUID
managername varchar(200) true Manager Name
divisionid varchar(50) true Division GUID
division_name varchar(50) true Division Name
startdate timestamp without time zone true Start Date
startdateusrtz timestamp without time zone true Start Date in User Timezone
timetype varchar(50) true Time Type
systempresenceid varchar(50) true System Presence GUID
systempresencename varchar true System Presence Name
presenceid varchar(50) true Presence GUID
presencetime numeric true Presence Time
presencetimeday numeric true Presence Time (Days)
routingid varchar(50) true Routing GUID
routingtime numeric true Routing Time
routingtimeday numeric true Routing Time (Days)
updated timestamp without time zone true Last Updated Time

Referenced Tables

Name Columns Comment Type
timezonecalcs 0
public.userpresencedatadaily 11 User Presence Data Daily Data - LTC - See UserPresenceData for Descriptions BASE TABLE
public.vwuserdetail 17 See UserDetail: User Description in detail VIEW
public.divisiondetails 4 BASE TABLE
public.presencedetails 7 Persence Code Lookup Data BASE TABLE

    • Related Articles

    • 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 ...
    • public.userpresencedata

      Description Columns Name Type Default Nullable Children Parents Comment keyid varchar(255) false id varchar(50) true userid varchar(50) true startdate timestamp without time zone false startdateltc timestamp without time zone true timetype ...