cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2343
Views
0
Helpful
6
Replies

UCCX 8.5 Historical Reporting Customization

josh.silva
Level 1
Level 1

I am building some custom reports for our orginization and have been going through the historical reporting administrator and development guide.  I noticed that the documentation references CRD.csd1, csd2, and csd3.  However, the contactroutingdetail table does not have theses fields.  Does anyone know what these referring to?  Is this referring to some inner join portion of the query?

1 Accepted Solution

Accepted Solutions

Erm... yeah, the timezone stuff is odd. The way that the HRC software deals with it is that all the entries in the DB are in UTC, and if your local PC running HRC is not in UTC then it offsets the start/end time of the report period.

So here in the UK, half the year we are UTC+1, and the rest we are UTC. So if you run a report that covers both periods... well.. it doesn't really make much sense.

It's thrown off a few of my reports where it's broken into 15 minute intervals and which 15 minutes you are talking about is important!

Well done though - reporting is fun in UCCX no?

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

View solution in original post

6 Replies 6

josh.silva
Level 1
Level 1

Whenever I run the following Query I get two less calls reported than the original canned report provided.

SELECT csqname, ROUND(sum(100 * (MetSL)/ (case when (MetSL + NotSL = 0) then 1 else (MetSL + NotSL) end)) ) as servicelevel,

totals, abandonded, handled, presented, aborted, rejected, dequeued

FROM(

SELECT csq.csqname

,sum( case cqd.metServiceLevel when 't' then 1 else 0 end) MetSL

,sum( case cqd.metServiceLevel when 't' then 0 else 1 end) NotSL

,COUNT(*) as totals

,sum( case when cqd.disposition = '1' then 1 else 0 end) abandonded

,sum( case when cqd.disposition = '2' AND acd.talktime <> '0' then 1 else 0 end) handled

,sum( case when cqd.targetType = '0' then 1 else 0 end) presented

,sum( case when ccd.contactDisposition = '4' then 1 else 0 end) aborted

,sum( case when ccd.contactDisposition >= '5' then 1 else 0 end) rejected

,sum( case when ccd.contactDisposition = '3' then 1 else 0 end) dequeued

FROM contactroutingdetail crd

INNER JOIN contactcalldetail ccd ON (crd.sessionid = ccd.sessionid AND crd.nodeid = ccd.nodeid

AND crd.sessionseqnum = ccd.sessionseqnum)

INNER JOIN contactqueuedetail cqd ON (ccd.sessionID = cqd.sessionID AND ccd.sessionSeqNum = cqd.sessionSeqNum

AND ccd.profileID = cqd.profileID AND ccd.nodeID = cqd.nodeID)

INNER JOIN contactservicequeue csq ON (cqd.targetID = csq.recordID)

INNER JOIN skillgroup skg ON (skg.skillgroupid = csq.skillgroupid)

INNER JOIN skill sk ON (sk.skillid = skg.skillid)

INNER JOIN agentconnectiondetail acd on (ccd.sessionID = acd.sessionID AND ccd.sessionSeqNum = acd.sessionSeqNum AND

ccd.profileID = acd.profileID AND ccd.nodeID = acd.nodeID)

WHERE crd.startdatetime > '2013-01-02 06:00:00.000' AND crd.startdatetime < '2013-01-03 05:59:59.999'

GROUP BY csqname ORDER BY csqname

) z

GROUP BY z.csqname, z.totals, abandonded, handled, presented, aborted, rejected, dequeued

ORDER BY csqname DESC

Hi Josh

Re: 'CRD.csd1, csd2, and csd3' - I've done lots of reports but I really don't know what they are specifically talking about. In general they are saying that for each queue a call is sent to (i.e. if the script does a 'select' to multiple queues for escalation purposes or whatever) that a seperate record is created in the ContactRoutingTable for each call-queue link.

Which report are you comparing that query to?

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

I am looking at the "Common Skill Contact Service Queue Activity Report".  Does my query look good though?  I can't find why I am short 2 calls in comparison.

josh.silva
Level 1
Level 1

Ok i got this answered myself.  The report that was looked at was the incorrect one.  They were looking at the Agent Call Summary Report.  This is broken down into two tasks.  The first is to query for all calls that are given to the Agent via ACD.  The below query is what I came up with to get that:

SELECT z.acd, x.nonacd, z.resourcename, (acd + nonacd) total, teamname, y.outbound FROM (

SELECT SUM(case when acd.talktime > '0' then 1 else 0 end) acd, resourcename, teamname

FROM agentconnectiondetail acd

INNER JOIN contactcalldetail ccd ON (ccd.sessionID = acd.sessionID

AND ccd.sessionSeqNum = acd.sessionSeqNum AND ccd.nodeID = acd.nodeID)

INNER JOIN resource r ON (acd.resourceID = r.resourceID AND acd.profileID = r.profileID)

INNER JOIN team t on (r.assignedteamid = t.teamid)

WHERE ccd.startdatetime > '2012-12-03 06:00:00.000' AND ccd.startdatetime < '2012-12-04 06:00:00.000'

AND ((

(WEEKDAY(ccd.startdatetime) <> '0' OR WEEKDAY(ccd.startdatetime) <> '6')

AND TO_CHAR(ccd.startdatetime,'%R') >= '14'

AND TO_CHAR(ccd.startdatetime,'%R') <= '24'

    )

OR (

(WEEKDAY(ccd.startdatetime) = '6')

AND TO_CHAR(ccd.startdatetime,'%R') > '16' AND TO_CHAR(ccd.startdatetime,'%R') < '20')

    )

AND t.teamname = 'Your Team Name Here'

GROUP BY resourcename, teamname) z

LEFT OUTER JOIN

(SELECT COUNT(*) nonacd, resourcename

FROM contactcalldetail ccd

INNER JOIN resource r ON (ccd.destinationID = r.resourceID AND ccd.profileID = r.profileID)

WHERE ccd.startdatetime > '2012-12-03 06:00:00.000' AND ccd.startdatetime < '2012-12-04 06:00:00.000'

AND ((

(WEEKDAY(ccd.startdatetime) <> '0' OR WEEKDAY(ccd.startdatetime) <> '6')

AND TO_CHAR(ccd.startdatetime,'%R') >= '14'

AND TO_CHAR(ccd.startdatetime,'%R') <= '24'

    )

OR (

(WEEKDAY(ccd.startdatetime) = '6')

AND TO_CHAR(ccd.startdatetime,'%R') > '16' AND TO_CHAR(ccd.startdatetime,'%R') < '20')

    )

GROUP BY resourcename) x ON z.resourcename = x.resourcename

LEFT OUTER JOIN

(SELECT COUNT(*) outbound, r.resourcename

FROM contactcalldetail ccd

INNER JOIN resource r ON (ccd.destinationID = r.resourceID AND ccd.profileID = r.profileID)

WHERE ccd.startdatetime > '2012-12-03 06:00:00.000' AND ccd.startdatetime < '2012-12-04 06:00:00.000'

AND ccd.originatorType ='1'

AND ((

(WEEKDAY(ccd.startdatetime) <> '0' OR WEEKDAY(ccd.startdatetime) <> '6')

AND TO_CHAR(ccd.startdatetime,'%R') >= '14'

AND TO_CHAR(ccd.startdatetime,'%R') <= '24'

    )

OR (

(WEEKDAY(ccd.startdatetime) = '6')

AND TO_CHAR(ccd.startdatetime,'%R') > '16' AND TO_CHAR(ccd.startdatetime,'%R') < '20')

)

GROUP BY r.resourcename

ORDER BY r.resourcename) y ON z.resourcename = y.resourcename

GROUP BY z.resourcename, acd, outbound, nonacd, teamname ORDER BY z.resourcename

This will give you all calls given to the agent.  Next you have to filter out the non-ACD calls that are transfers or direct calls.  This is the query I came up with for that.

SELECT COUNT(*) common, z.resourcename FROM(

SELECT * FROM agentconnectiondetail acd

INNER JOIN contactcalldetail ccd ON (ccd.sessionID = acd.sessionID

AND ccd.sessionSeqNum = acd.sessionSeqNum AND ccd.nodeID = acd.nodeID)

INNER JOIN resource r ON (acd.resourceID = r.resourceID AND acd.profileID = r.profileID)

INNER JOIN team t on (r.assignedteamid = t.teamid)

WHERE ccd.startdatetime > '2012-12-03 06:00:00.000' AND ccd.startdatetime < '2012-12-04 06:00:00.000'

AND ((

(WEEKDAY(ccd.startdatetime) <> '0' OR WEEKDAY(ccd.startdatetime) <> '6')

AND TO_CHAR(ccd.startdatetime,'%R') >= '14'

AND TO_CHAR(ccd.startdatetime,'%R') <= '24'

    )

OR (

(WEEKDAY(ccd.startdatetime) = '6')

AND TO_CHAR(ccd.startdatetime,'%R') > '16' AND TO_CHAR(ccd.startdatetime,'%R') < '20'))

ORDER BY r.resourceid, ccd.sessionid, ccd.startdatetime, teamname) z

INNER JOIN (SELECT *

FROM contactcalldetail ccd

INNER JOIN resource r ON (ccd.destinationID = r.resourceID AND ccd.profileID = r.profileID)

WHERE ccd.startdatetime > '2012-12-03 06:00:00.000' AND ccd.startdatetime < '2012-12-04 06:00:00.000'

AND ((

(WEEKDAY(ccd.startdatetime) <> '0' OR WEEKDAY(ccd.startdatetime) <> '6')

AND TO_CHAR(ccd.startdatetime,'%R') >= '14'

AND TO_CHAR(ccd.startdatetime,'%R') <= '24'

    )

OR (

(WEEKDAY(ccd.startdatetime) = '6')

AND TO_CHAR(ccd.startdatetime,'%R') > '16' AND TO_CHAR(ccd.startdatetime,'%R') < '20'))

ORDER BY r.resourceid, ccd.startdatetime) x ON (z.sessionid = x.sessionid AND z.sessionseqnum = x.sessionseqnum AND z.profileID = x.profileID AND z.nodeID = x.nodeID) GROUP BY z.resourcename

The last task is to take both sets of results and subtract the second query from the first sets nonacd column.  The second query insures that you are taking out calls that originated in ACD and are already counted.  Hope this helps anyone that needs it.  Oh one more thing.  The custom filters you see with the TO_CHAR(ccd.startdatetime,'%R') is just filtering the time to just 8:00 am CST to 6:00 pm CST and making sure that the days are M-Saturday with the WEEKDAY function.  Remember that the UCCX database is in UTC time and will need to be filtered according to your timezone.  For CST my queries needed to add 6 hours to the time desired to get the correct data set.

Erm... yeah, the timezone stuff is odd. The way that the HRC software deals with it is that all the entries in the DB are in UTC, and if your local PC running HRC is not in UTC then it offsets the start/end time of the report period.

So here in the UK, half the year we are UTC+1, and the rest we are UTC. So if you run a report that covers both periods... well.. it doesn't really make much sense.

It's thrown off a few of my reports where it's broken into 15 minute intervals and which 15 minutes you are talking about is important!

Well done though - reporting is fun in UCCX no?

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

It is when you are able to make sense of the chaos that is the UCCX database relations and codes they use.   It is fun though.  Cheers Aaron.