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!

Eliminate cases with zero turnover time 1

Status
Not open for further replies.

newbie0423

IS-IT--Management
Oct 29, 2012
103
US
I have a report that shows the time that a patient leaves the room until the next patient comes into the room (turnover time) I've created a formula to calculate the averages, but they are showing incorrectly because of the cases with zeros.
Looking at the example below. The average time is 42 is you're just counting two records, but because Crystal is counting three records the average is 28 which is what I don't want it to do. How can I eliminate the records with zero

Time In Time OUt Turnover
903 1001 0
1051 1506 50
154 1617 34


I've tried using


If {YourField} <> 0 then
(
Add and count
);

but this isn't working.
 
Use a Running Total and average your Turnover Time.

In the Evaluate section of the RT set up add the condtion

TurnoverTime <> 0

Ian
 
Thanks Ian, however I'm not able to use a running total to average the turnover. I've used variables (see below)


WhilePrintingRecords;
Global NumberVar TotalHours;
Global NumberVar WorkOrderCount;
TotalHours / WorkOrderCount


WhilePrintingRecords;
Global NumberVar TotalHours;
Global NumberVar WorkOrderCount;
Local NumberVar currentdiff;

if {@time diff} > 120 then
currentdiff := 0
else
currentdiff := {@time diff};


TotalHours := TotalHours + currentdiff;
WorkOrderCount := WorkOrderCount + 1;
currentdiff
 
Change your work order count to only increment if currentdiff <> 0

If currentdiff <> 0 then WorkOrderCount := WorkOrderCount + 1;

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top