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

Report or query for all agents assigned to attribute or precision queue in UCCE

ccoombs
Level 1
Level 1

Is there a way to get a list of all agents assigned to a specific attribute or PQ??

 

Thank you

6 Replies 6

Omar Deen
Spotlight
Spotlight

You can use something simple like this query

SELECT P.FirstName, P.LastName, A.EnterpriseName, AT.AttributeValue, ATT.EnterpriseName
FROM Agent A, Agent_Attribute AT, Attribute ATT, Person P
WHERE A.SkillTargetID = AT.SkillTargetID
AND ATT.AttributeID = AT.AttributeID
AND A.PersonID = P.PersonID
AND A.EnterpriseName IN ('5000.1329894','5000.3859437','5000.2212787','5000.9871826')

Replace the Agent Enterprise Names with your own. Use the = comparison operator for one agent or the IN logical operator for multiple agents.

Hi Omar,

the enterrprise name that we pass on this line (

AND A.EnterpriseName IN ('5000.1329894','5000.3859437','5000.2212787','5000.9871826')

is that the Attribute name or the Agent name ?

Personally, I pull it for all attributes and then sort them in Excel. Typically the business is asking for what do all of my agents have, and doing the full export will prevent the "my agent got calls for some unrelated group since we didn't realize that they had some unknown attribute assigned to them" type problem. Plus you can easily filter them in Excel, and as a bonus you have a snapshot in time of what everyone had. just my $.02.

A.Enterprise name is agent name.

piyush aghera
Spotlight
Spotlight

Here are two queries that I use and created reports within CUIC using them:

1. List of agents assigned to a particular PQ, where PQ is filter criteria. It also has last login date/time of an agent. Change PQ.PrecisionQueueID with PrecisionQueueID from your system.

SELECT DISTINCT A.SkillTargetID ,P.FirstName,P.LastName,P.LoginName, A.PeripheralNumber as Extension,
AAA.EnterpriseName as Atribute, convert(varchar, aed.LoginDateTime,120) as LastLoginTime ,PQ.EnterpriseName as Precision_Q_Name
FROM
Agent A,Person P, Attribute AAA, Agent_Event_Detail aed , Agent_Attribute AA,Precision_Queue_Term PQT,Precision_Queue PQ
WHERE
A.PersonID=P.PersonID
and
A.SkillTargetID =AA.SkillTargetID
and
AA.AttributeID =AAA.AttributeID
and
AAA.AttributeID =PQT.AttributeID
and
PQ.PrecisionQueueID =PQT.PrecisionQueueID
and PQ.PrecisionQueueID in (5124)
and A.SkillTargetID = aed.SkillTargetID
and aed.LoginDateTime = (select max(Agent_Event_Detail.LoginDateTime) from Agent_Event_Detail where Agent_Event_Detail.SkillTargetID = A.SkillTargetID group by Agent_Event_Detail.SkillTargetID)
order by A.SkillTargetID

piyush aghera
Spotlight
Spotlight

Second query, that lists out agents for a particular attribute. Change ATT.AttributeID value with your AttributeID.

SELECT
ATT.AttributeID
, A.EnterpriseName as Agent_Name
, Person.LastName + ', ' + Person.FirstName as Name
, ATT.EnterpriseName as Assigned_Attribute
, AA.AttributeValue as Attribute_Value
, CASE ATT.AttributeDataType
WHEN 0 THEN 'UNKNOWN'
WHEN 1 THEN 'INTEGER'
WHEN 2 THEN 'STRING'
WHEN 3 THEN 'BOOLEAN'
WHEN 4 THEN 'SKILL BASED'
END as Attribute_Type
FROM
Agent_Attribute AA,
Agent A,
Attribute ATT,
Person
WHERE ATT.AttributeID IN (5065) and
AA.SkillTargetID = A.SkillTargetID
and
AA.AttributeID = ATT.AttributeID
and A.PersonID = Person.PersonID