Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting the number of times a status occurs

Status
Not open for further replies.

Kevinski

Technical User
Jan 4, 2001
95
NZ
Hello
I'm using CR 8.5 and have a report which evaluates service calls by a number of criteria.

For example it calculates the amount of elapsed time, since a call was opened, that various statuses of the call are reached - ie "allocated" "work started" "parts ordered" "Ready to finish" "Finished" etc etc.

The problem is that there are a possible 20+ statuses and any given call can theoretically reach any of these statuses any number of times. Is there a way to count, per call, the number of times a status occurs? I have tried inserting running totals etc but this doesn't work.

The current report is ungrouped and looks roughly like this (I've added a column for 'COUNT' which is the subject of this post to give you an idea of what I'm after):

Call No Logged Status StatusTime Elapsed time COUNT
1 9AM Allocate 9:10AM 10 mins 1
1 9AM Orderpart 9:15AM 15 mins 1
1 9AM Allocate 9:30AM 30 mins 2
1 9AM Orderpart 9:45AM 45 mins 2
1 9AM Orderpart 9:50AM 50 mins 3
1 9AM Orderpart 9:55AM 55 mins 4
1 9AM Allocate 9:58AM 58 mins 3
2 9:15AM Allocate 9:20AM 5 mins 1
2 9:15AM Start 9:30AM 15 mins 1
2 9:15AM Allocate 9:35AM 20 mins 2
2 9:15AM Start 9:40AM 25 mins 2

So in other words call 1 has so far been in the "Allocate" status 3 times and the "Orderpart" status 4 times etc etc similar for call 2

The problem is arising because I'm exporting this data as a spreadsheet and doing some further analysis and I'm finding that a lot of calls reach "Awaiting Finish" a number of times and I'm really only interested in the LAST time. So I'd like to keep the report ungrouped, keep a running total of all statuses per call and perform my other calcs in the spreadsheet.

Any help appreciated
 
Your requirement of no groups makes this an onerous task. You would have to do a running total per status per phone call as follows, using the running total editor, for example:

Select {CallNo}, count, evaluate on change of formula:

{CallNo} = 1 and Status = "Allocate"

This is not much better than just counting manually. Why not give grouping a chance? At least group on {Call}. Make sure your date fields are sorted {LogTime} ascending.

Then your running total could be:

Select {CallNo}, count, evaluate on change of formula:

{Status} = "Allocate"//Replace this with 19 other statuses in 19 other running totals.

Reset on change of Group (Call).

Place this in your Group footer, along with a descriptive text box and your report still has the detail you described, but now has a summary section:

Call 1:
# Allocate: 3
# OrderPart: 2

If you want to have only the most recent row available for one of the statuses, you're better off also grouping by status, and changing your running total to evaluate on every field, reset on change of Group2(status). Then your data looks like:

Call No Logged Status StatusTime Elapsed time COUNT
Call 1 (GH1)
Allocate (GH2)
1 9AM Allocate 9:10AM 10 mins 1
1 9AM Allocate 9:30AM 30 mins 2
1 9AM Allocate 9:58AM 58 mins 3
Allocate (GF2) Subtotal 3

Orderpart (GH2)
1 9AM Orderpart 9:15AM 15 mins 1
1 9AM Orderpart 9:45AM 45 mins 2
1 9AM Orderpart 9:50AM 50 mins 3
1 9AM Orderpart 9:55AM 55 mins 4
Orderpart (GF2) Subtotal 4
Call 2
Allocate (GH2)
2 9:15AM Allocate 9:20AM 5 mins 1
2 9:15AM Allocate 9:35AM 20 mins 2
Allocate (GF2) Subtotal 2

Orderpart (GH2)
2 9:15AM Start 9:30AM 15 mins 1
2 9:15AM Start 9:40AM 25 mins 2
Orderpart (GF2) Subtotal 2

Or you could suppress the headers and details and jsut display the footers. To show the most recent record of only one of your statuses ("Awaiting Finish"), drag the detail fields into the group footer and conditionally suppress each field with the formula:

{status} <> &quot;Awaiting Finish&quot;

Note that you can hide or suppress group headers or footers by using &quot;Format section&quot; and then export just the details to Excel for calculations, or suppress the details and/or other sections, and export selected summary sections to Excel. Since you can sort in Excel, you could easily recreate your original detail order in Excel, while gaining all the advantages of the grouping options in Crystal. This would make your task much easier, I'm guessing.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top