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

Is there a way to show a ratio in Crystal reports?

Status
Not open for further replies.

jschill2628

Programmer
Nov 3, 2009
156
US
Is there a way to show a ratio in Crystal reports? I don’t want a percentage I want the actual numbers i.e. 1/100 not 0.01 or 1%. I assume there is a formula, but I can’t think how that would go.

For example I have:
309 serious events, 20,923 Precursor Events, And 5,916 Near Miss Events
I want to show 309/20,923 and 309/5716.
Is there a way to show this in a cross tab or in the details section?

Thanks in advance.
 
hi,

Can't tell you anything about CR. This is not a CR forum! Try forum767.

Excel CAN has a NumberFormat for displaying values as fractions.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
You would basically convert the numbers to text and create a string (i.e., totext({firstNumber},0,"")+"/"+totext({secondNumber},0,"") ). I think I used the correct syntax to totext.
 
totext({firstNumber},0,"")+"/"+totext({secondNumber},0,"")

the field (first and second number) is a coded field.
So I was wondering if I could write a formula such as the following: {near miss}

if {IRSCODE.CODE}in ["NME1", "NME2", "NME3"] then "Near Miss" else
if {IRSCODE.CODE}in ["PSE1", "PSE2", "PSE3", "PSE4"] then "Precursor" else
if {IRSCODE.CODE}in ["SSE1", "SSE2", "SSE3", "SSE4", "SSE5"] then "Serious Event" else
"Not Applicable"

And then implement it somehow into your formula
totext(if {IRSCODE.CODE}in ["SSE1", "SSE2", "SSE3", "SSE4", "SSE5"] then "Serious Event" ,0,"")
+"/"+ totext((if {IRSCODE.CODE}in ["NME1", "NME2", "NME3"] then "Near Miss"),0,"")
Or
mid(towords({@Near Miss}), instr(towords({@Near Miss}), "and")+4)

but these are not working, I am missing something, and I am just to close to this to see what I am missing.

Thanks in advance again :)
 
let me clarify what I am trying to so. I would like to get two different ratios. the first being Serious event/ near miss, and the second one being Serious event/ Precursor. and as you can see from above the field that I am pulling from is a coded field.

Thanks for all your help!
 

As SkipVought mentioned, this is not the appropriate forum. Please repost your question here: forum767.

Hope this helps.

Please help us help you. Read Tek-Tips posting polices before posting.
Canadian members check out Tek-Tips in Canada for socializing, networking, and anything non-technical.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top