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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula for Counting Values that are 0 and positive

Status
Not open for further replies.

Jonathan212

IS-IT--Management
Oct 22, 2002
57
US
I am using a group selection formula to find the minimum, or first case of the day, in a operating room. This formula is working correctly. The formula is:

pcmOpTime.timePatientInRoom} = minimum ({pcmOpTime.timePatientInRoom},
{pcmORroom.orName})

I am using a formula to calculate variance in scheduled start time to actual start time, and the formula is called @VarStart (number) and this formula is working correctly and is:

datediff("n",{pcmCase.actualStartTime},{pcmCase.scheduledStartTime})

I am able to determine the number of cases in a month that had “0”, but I can’t figure out yet how to identify the number of cases that had 0 as well as a positive variance. For example, if I had varstart of:

-10
0
7
0
9
-12

I would like to be able to report a count of 4. Thus far, when I do range for varstart (e.g., 0 or greater) it seems to mess up my group selection formula.

Any recommendations for doing a running total formula or using some other formula to get my count would be helpful.

I am using CR10.

Thank you very much in advance.
Jonathan
 
Because you are using a group selection formula, you would need to use a running total, that did a count of some recurring field, evaluate using a formula:

{@VarStart} >= 0

Reset on change of group (your month group).

-LB
 
Create a formula, as in:

whileprtintingrecords;
numbervar PozTotal;
if datediff("n",{pcmCase.actualStartTime},{pcmCase.scheduledStartTime}) >= 0 then
PozTotal:=PozTotal+1

Then display it later using:

whileprtintingrecords;
numbervar PozTotal

-k
 
My sincere appreciation LB and -k for your timely and quality repsonses. Your solutions work perfectly. I am most thankful to both of you for your help all year. Jonathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top