I need to create a report on a phone call center system which reports on agent activtities.
Each agent has action records written to the database when they do differenct actions (Pick up, break, dial, etc...) Some actions are able to run at the same time as previous actions so causes a problem when calculating the duration of each action.
Can anyone please help me in creating a peice of code which looks at the previous action written for the agent to determine whether it is running durring the new action or finishes as the new action starts? If the new action is running at the same time as the previous action then use the previous action end time as the new action start time.
Cheers, Joe
P.s. I have started by grouping the agents and created this code:
LOAD AgentTrackingAgentIDGroup, AgentAction, AgentTrackingStartTime, AgentTrackingEndTime, AgentActionDuration, If ( AgentAction = 'Pause', If ( Previous(AgentTrackingEndTime) > AgentTrackingStartTime, AgentTrackingEndTime- Previous(AgentTrackingEndTime), AgentActionDuration ) ) AS CalcActionDur, Sum (AgentActionDuration) AS DurSum RESIDENT AgentTracking
GROUP BY AgentTrackingAgentID, AgentAction, AgentTrackingStartTime, AgentTrackingEndTime, AgentActionDuration;