dan_stan
asked on
Crystal Reports help
Hi,
I am trying to build a report in crystal that shows me a number of stats per anaylst in my helpdsk system. I want to see:
A list of all analyst names
The number of calls they have logged
The number of calls they have closed
The last date that have logged in
I have two tables in my system.
The table where my analysts ID's,Names and last login dates are stored in sw_systemdb.swanalysts
swanalysts.analystid this is the unique ID of the analyst.
swanalysts.name this is the analyst name.
swanalysts.lastlogin this is the date when the user last logged in.
The table to see who has logged and closed a call is in a table called swdata.opencall,
to see who logged / closed the call, there are two fields..
opencall.loggedby this gives the analyst's ID who logged the call
opencall.closedby this gives the analyst's ID who closed the call
The statement below, joins the two tables together by the analysts ID. I have attached some sample data.
What I do not understand is how to build the report that shows a list of analyst names, ,the date they last logged in and the calls they have logged / closed.
I understand i need to group the anaylst, but I'm not sure on which field.
Can anyone help me?
sample-data.xlsx
I am trying to build a report in crystal that shows me a number of stats per anaylst in my helpdsk system. I want to see:
A list of all analyst names
The number of calls they have logged
The number of calls they have closed
The last date that have logged in
I have two tables in my system.
The table where my analysts ID's,Names and last login dates are stored in sw_systemdb.swanalysts
swanalysts.analystid this is the unique ID of the analyst.
swanalysts.name this is the analyst name.
swanalysts.lastlogin this is the date when the user last logged in.
The table to see who has logged and closed a call is in a table called swdata.opencall,
to see who logged / closed the call, there are two fields..
opencall.loggedby this gives the analyst's ID who logged the call
opencall.closedby this gives the analyst's ID who closed the call
The statement below, joins the two tables together by the analysts ID. I have attached some sample data.
select
,a.name 'loggedby'
,b.name 'closedby'
,c.name 'completedby'
,d.name 'lastactby'
from swdata.opencall o
join sw_systemdb.swanalysts a on a.analystid = o.loggedby
join sw_systemdb.swanalysts b on b.analystid = o.closedby
join sw_systemdb.swanalysts c on c.analystid = o.completeby
join sw_systemdb.swanalysts d on d.analystid = o.lastactby
What I do not understand is how to build the report that shows a list of analyst names, ,the date they last logged in and the calls they have logged / closed.
I understand i need to group the anaylst, but I'm not sure on which field.
Can anyone help me?
sample-data.xlsx
ASKER
I do not think this would work as the person who logs the call doesn't always close the call.
Also how do I group all of my anaylst ID's? I could take the opencall.loggedby, but this will only show me the ID's who logged the call.
Also how do I group all of my anaylst ID's? I could take the opencall.loggedby, but this will only show me the ID's who logged the call.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, how do you suggest I append the close cases / open cases.
So far I built the statement so that if looks like the below. I think it works, although would like to have your thoughts as well.
So far I built the statement so that if looks like the below. I think it works, although would like to have your thoughts as well.
SELECT
FROM_UNIXTIME(logdatex)
,o.callref
,1 as loggedby
,0 as closedby
,a.name
,a.lastlogontime
FROM opencall o
join sw_systemdb.swanalysts a on a.analystid = o.loggedby
UNION ALL SELECT
FROM_UNIXTIME(logdatex)
,o.callref
,0 as loggedby
,1 as closedby
,a.name
,a.lastlogontime
FROM opencall o
join sw_systemdb.swanalysts a on a.analystid = o.closedby
Looks OK to me.
ASKER
Me too, many thanks for your support.
In the Detal section show any desired info about the calls
Create a formula that returns 1 if the call is closed and zero otherwise. SUM that formula (note: do not Count, you must use SUM) to give you the number of calls closed by that analyst.
Do the same for opened cases.
Note: you could do the same using Running Totals with a condition applied to the type of transaction. But the approach above has several advantages over Running Totals.