Link to home
Start Free TrialLog in
Avatar of dan_stan
dan_stan

asked on

Division by Zero error

Hi,

In Crystal i am trying trying to show the percentage of calls that were resolved within SLA grouped by the priority of the call, for example -

High 90%
Medium 98%
Low 99%

In my database if a call is within SLA then a field called 'withininfix' has a value of 0 or 1
1 = Within fix
0 = Not within fix.

I have the following formulas for each SLA -

#P1 - This formula counts the number of high calls

If (Command.priority} <> "High" then 1

#P1_fix - This counts the number of high priority calls within SLa

if {command.withinfix} = 1 and {Command.priority} = "High"
then 1 else 0

#P1% - This formula calculates the percentage of high calls within SLA

SUM ({@#P1_fix}) / SUM ({@#P1}) * 100 & "%"

When running the report I get a division by zero error, on the #P1% formula.

Can anyone help me?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dan_stan
dan_stan

ASKER

Thanks guys
FWIW, you said that #P1 counts the number of high calls, but you have <> "High" in your post, so that formula is actually counting the calls that are _not_ "High".

 Also, you might want to avoid using "#" at the beginning of a formula name.  CR puts a "#" at the beginning of running total names, so if you ever use running totals, it could get a bit confusing.

 James