06-22-2020 08:45 AM
Is there a way to get a list of all agents assigned to a specific attribute or PQ??
Thank you
06-22-2020 09:17 AM
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.
10-17-2024 09:57 PM
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 ?
10-18-2024 04:24 AM
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.
01-14-2025 09:03 AM
A.Enterprise name is agent name.
01-14-2025 09:05 AM - edited 01-14-2025 09:07 AM
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
01-14-2025 09:07 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide