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

Totals and Percentages 1

Status
Not open for further replies.

Honyo

IS-IT--Management
Dec 26, 2002
19
CA
Hi

Please can someone help me with an issue that has me running around in circles.

The report is pulling data from SQL
I have a group called {Trans_Feature_Info.BTN}
Under BTN it lists a status of calls Y,N or I
pass=Y ; incomplete=I ; fail=F
Some BTN's are listed more than once

If BTN is listed more than once, then I want to do calculations on it.

1) A count of all the BTN's in that group
Count ({Trans_Feature_Info.BTN}, {Trans_Feature_Info.BTN})

This now works

2) An average pass rate for the BTN's
e.g.

BTN 77777 Y
Total BTN:1 Average Pass Rate = 100%

BTN 88888 N
Total BTN: 1 Average Pass Rate = 0%

BTN 99999 Y
BTN 99999 N
BTN 99999 I
BTN 99999 Y
Total BTN: 4 Average Pass Rate = 50%



How do I calculate the average pass rate. I can get it for the all the data, but nor for each group!

PLEASE HELP!

Regards
Honyo
 
Create a formula for passes {@pass} and place it in the details section:

if {Trans_Feature_Info.BTN} = "Y" then 1 else 0

Create a second formula for placement in the group footer section:

sum({@pass},{Trans_Feature_Info.BTN})%count({Trans_Feature_Info.BTN},{Trans_Feature_Info.BTN})

-LB
 
HI

Thanks for the info. I tried it but it just gives me 0 values.

Regards
Honyo
 
Perhaps you have not formatted the result so that it appears as a percent? I.e., .35 would appear as 0 if you have it formatted to no decimals.

If it's not a formatting issue, please post both formulas that I suggested as you implemented them.

-LB
 
Also, put the pass formula on the detail band so that you can confirm that you are getting the ones and zeros on the correct records.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- tek@kenhamady.com
 
Thanks to all,

I got it to work. I had the test 1 formula in the details section but was still getting 0.00 for all fields. I changed the first formula to read:

local numbervar pass;

if ToNumber({Transaction_Info.Pass_Fail}) = 1 then
pass := pass + 1

I then used your second formula lbass, and it worked fine. I also don't have to keep the first formula in the details section.

Thanks again for the help

Cheers
Honyo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top