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

Averarging Only the Formula

Status
Not open for further replies.

cretanion

Technical User
Jan 28, 2002
53
US
I have Open and Closed Calls

Incident # Seconds Opened Seconds Closed
1111 12
2222 10

For Open Calls
if {Incident.State:} = "O" then DateDiff ("s",{Incident.Open Date & Time},{@currentdate})

For Closed Calls
if {Incident.State:} = "C" then DateDiff ("s",{Incident.Open Date & Time},{Incident.Close Date & Time})

I do a average for both formulas' but I only want averages if the Call is Opened or Call is Closed. In this generic example I would like to only see 12 seconds for the average Open instead I get 6, because it seems to count the 2 records.

Thanks for the help in advance!!!

 
You don't mention which version of Crystal you use, but you probably have running totals. create a running total average on the field and tell it to evaluate on a formula and have the formula be something along the lines of:

{Incident.State:} = "O" for the open formula..

Lisa
 
Sum(@seconds_opened)/Count({Incident.No},{Incident.State},{Incident.State}='O')
Sum(@seconds_closed)/Count({Incident.No},{Incident.State},{Incident.State}='C')

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top