Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Calculating total labor Post Reply Post New Topic
Author Message
shawks
Newbie
Newbie
Avatar

Joined: 04 Sep 2007
Location: United States
Online Status: Offline
Posts: 7
Quote shawks Replybullet Topic: Calculating total labor
     Posted: 05 Mar 2008 at 9:46am

I am using Crystal 10.  I am trying to find the total amount of time field techs spend at a site for a case.  For example if techs visit a site four different times we need to find the duration of each visit to determine the grand total of time at the site.  The next case could have one or more visits or even zero visits.

 The table I am using lists an event (Arrive, Depart, Close Case, etc - may not be related to the field tech - such as the calls to help center or dispatching to field tech) with a time/date stamp for the event plus site id, case id, tech name, etc.  So for the example above there would be four "Arrive" events and four "Depart" events (unless the last interaction was "Close Case" then there would be three "Departs" and the last would be "Close Case").

 The records are currently being grouped by site id and then case id.

<>Below are some sample data from one case.  The total labor time for techs at the site is about 21 minutes.  It is possible that non-onsite X_EVENTs could occur before, after, or during the field tech's visit.  There are none in this case but it could occur.

<>

CASE_ID CREATION_TIME CASE_STATUS CASE_CONDITION X_EVENT X_ADDNL_INFO X_EVENT_TIME SITE_ID ONSITE_TECH
2232467 2/12/2008 10:36:40 AM Closed-FS-OnSite Fix Closed Arrive 2/28/2008 11:44:29 AM 10101 12345
2232467 2/12/2008 10:36:40 AM Closed-FS-OnSite Fix Closed Arrive 2/28/2008 12:05:09 PM 10101 54321
2232467 2/12/2008 10:36:40 AM Closed-FS-OnSite Fix Closed Close FS-OnSite Fix 2/28/2008 12:05:57 PM 10101 54321
2232467 2/12/2008 10:36:40 AM Closed-FS-OnSite Fix Closed Departed Part Ordered-Down 2/28/2008 12:04:46 PM 10101 12345
2232467 2/12/2008 10:36:40 AM Closed-FS-OnSite Fix Closed First Dispatch Field Queue 2/12/2008 10:37:16 AM 10101 22377

Thanks for any assistance you can provide.
IP IP Logged
Iago
Groupie
Groupie
Avatar

Joined: 01 Oct 2007
Location: United States
Online Status: Offline
Posts: 52
Quote Iago Replybullet Posted: 06 Mar 2008 at 2:19pm
The big problem I see is that for a single Case ID you may have the same tech Arrive and depart multiple time.  I am not sure how to work around that without a visit ID.
 
I think you will be closer to a solution if you add the table twice and join by case ID and Tech ID.  This might make more sense with two SQL views of your data, one with only Arrive times and the other with only depart times and join the views by tech ID and Case ID.  You would then have the arrive time and depart time on the same row.  What you really need is a visit ID.
IP IP Logged
shawks
Newbie
Newbie
Avatar

Joined: 04 Sep 2007
Location: United States
Online Status: Offline
Posts: 7
Quote shawks Replybullet Posted: 12 Mar 2008 at 7:14am
Unfortunately no way to add a visit ID at this time.  The other method is problematic too since there are more "Events" that need to be evaluated for this report.
 
Any other ideas?  Thanks.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum