Solved

# How can I fix my  an error in crystal report formula?

Posted on 2014-09-04
227 Views
In a formula I am comparing 2 number to evaluate if (%a >= %b).  It seems to work - but getting errors some. (Both are numbers)

if {@ratio2}>={@.Goal2} then "Pass"
else "Fail"

RATIO:
local buildit as number
local truncit as number
local strit as string
If {Core_.DE} = 0 Then
formula = "n/a"
Else
buildit = ({Core_.NU}/{Core_.DE})*100
truncit = round(buildit, 0)
strit = totext(truncit, 0)
formula = strit
end if
tonumber(Round(({Core_.NU}/{Core_.DE})*100, 0))

Goal:

If {@Metric Name}= "Orders" Then 0.3 Else
If {@Metric Name}= "Medication" Then 0.4 Else

Thanks
0
Question by:Eric Love
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• Learn & ask questions

LVL 101

Expert Comment

ID: 40303448
What is the MetricName formula?

The GOAL formula appears to be incomplete.

What errors are you getting?

Can any of the database fields be NULL?

Are you using a mix of VB and Crystal syntax in the formulas?

mlmcc
0

LVL 35

Accepted Solution

James0628 earned 500 total points
ID: 40305531
I don't use Basic syntax, but isn't the ratio formula setting the result to be a string (either "n/a", or the string variable strit) ?

If the goal formula is producing a number, then you'll get an error when you try to compare the results from the two formulas.

First guess:
Maybe you want to change
formula = "n/a"
to
formula = 0

And change
formula = strit
to
formula = truncit

And you should probably remove the last line from the ratio formula (the ToNumber function after the "end if"), since I don't think it does anything.

James
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
###### Suggested Courses
Course of the Month11 days, 13 hours left to enroll

#### 623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.