question911
MIS
Hello,
I am trying to develop a custom Crystal Report using two views that are linked together. I am trying to sum the "HOLDTIME" which is grouped by skillset and then by agent/csrs. The relationship between skillset and agents/csrs is many to many. That is a CSR can be in one or more skillsets and a skillset can have one or more agents. The two views are iagentperformancestat and iagentbyskillsetstat. These views are inner equal joins based on timestamp and userid fields (keys).
The results of my SQL was not what I had expected. Lets say for example, Jessica (CSR) is assigned to recieve calls from Skillset 1 and Skillset 2. Furthermore, lets say she has a total "HoldTime" of 872 seconds from both skillsets combined. This is what the standard agentperformance report reveals. In my custom Crystal Report, I was expecting to see the total "HoldTime" of 872 broken down by skillsets for Jessica (CSR). So, for example, When Jessica received calls from skillset 1 she would have 500 seconds of "HoldTime" and when Jessica recived those calls from skillset 2, she would have 372 seconds of "HoldTime". This does not show up on custom Crystal Report. The Custom Crystal Reports shows 872 seconds for each skillset Jessica is assigned to. Anyone know whats causing this problem?
SELECT
iAgentBySkillsetStat.Skillset,
iAgentBySkillsetStat.AgentLogin,
SUM (iAgentPerformanceStat.HoldTime)
FROM
blue.dbo.iAgentBySkillsetStat iAgentBySkillsetStat,
blue.dbo.iAgentPerformanceStat iAgentPerformanceStat
WHERE
iAgentPerformanceStat.Timestamp = iAgentBySkillsetStat.Timestamp AND
iAgentPerformanceStat.UserID = iAgentBySkillsetStat.UserID AND
iAgentBySkillsetStat.Timestamp BETWEEN {ts '2004-04-12 00:00:00.000'} AND {ts '2004-04-12 23:45:00.000'}
GROUP BY
iAgentBySkillsetStat.Skillset, iAgentBySkillsetStat.AgentLogin
ORDER BY
iAgentBySkillsetStat.Skillset ASC,
iAgentBySkillsetStat.AgentLogin ASC
I am trying to develop a custom Crystal Report using two views that are linked together. I am trying to sum the "HOLDTIME" which is grouped by skillset and then by agent/csrs. The relationship between skillset and agents/csrs is many to many. That is a CSR can be in one or more skillsets and a skillset can have one or more agents. The two views are iagentperformancestat and iagentbyskillsetstat. These views are inner equal joins based on timestamp and userid fields (keys).
The results of my SQL was not what I had expected. Lets say for example, Jessica (CSR) is assigned to recieve calls from Skillset 1 and Skillset 2. Furthermore, lets say she has a total "HoldTime" of 872 seconds from both skillsets combined. This is what the standard agentperformance report reveals. In my custom Crystal Report, I was expecting to see the total "HoldTime" of 872 broken down by skillsets for Jessica (CSR). So, for example, When Jessica received calls from skillset 1 she would have 500 seconds of "HoldTime" and when Jessica recived those calls from skillset 2, she would have 372 seconds of "HoldTime". This does not show up on custom Crystal Report. The Custom Crystal Reports shows 872 seconds for each skillset Jessica is assigned to. Anyone know whats causing this problem?
SELECT
iAgentBySkillsetStat.Skillset,
iAgentBySkillsetStat.AgentLogin,
SUM (iAgentPerformanceStat.HoldTime)
FROM
blue.dbo.iAgentBySkillsetStat iAgentBySkillsetStat,
blue.dbo.iAgentPerformanceStat iAgentPerformanceStat
WHERE
iAgentPerformanceStat.Timestamp = iAgentBySkillsetStat.Timestamp AND
iAgentPerformanceStat.UserID = iAgentBySkillsetStat.UserID AND
iAgentBySkillsetStat.Timestamp BETWEEN {ts '2004-04-12 00:00:00.000'} AND {ts '2004-04-12 23:45:00.000'}
GROUP BY
iAgentBySkillsetStat.Skillset, iAgentBySkillsetStat.AgentLogin
ORDER BY
iAgentBySkillsetStat.Skillset ASC,
iAgentBySkillsetStat.AgentLogin ASC