Calculating the success rate

  • Thread starter chris0309 via AccessMonster.com
  • Start date
C

chris0309 via AccessMonster.com

Hi all,

I have a report and one of the columns is for success rates.

example,

Success Rates
-------------------------
Success
Success
Failure
Success
Failure

What I want to do is to find the average success rate. Can anyone help with
getting the answer?

Cheers,

Chris
 
K

KC-Mass

Hi

How would you Average Text Values?? What would your sample data yeild??

Regards
Kevin
 
C

chris0309 via AccessMonster.com

I can change the success to 1 and failure to 0. Im looking for a way to
total the amount of successes and failures then divide the total number of
succesful runs by the number of total runs (success + failures) to get the
average successful runs.
 
K

KC-Mass

Hi Chris,

I don't believe you are looking for an "average" but rather a "percentile".
That is, what percent of the tests were "Successful".

Assuming you have a table named "tblResults" with a field named "Result"
the below query will get you the counts of "Success" and "Failure". You can
then make further
calculations with those values in a form, report or further queries.

SELECT tblResults.Result, Count(tblResults.Result) AS CountOfResult
FROM tblResults
GROUP BY tblResults.Result;

Regards

Kevin
 
J

John W. Vinson

Hi all,

I have a report and one of the columns is for success rates.

example,

Success Rates
-------------------------
Success
Success
Failure
Success
Failure

What I want to do is to find the average success rate. Can anyone help with
getting the answer?

Cheers,

Chris

What's the context? Do you want the percentage of Success over the entire
table, or is there some other field (you mention a "run") that identifies a
subset?

If it's over the entire table, create a query. In a vacant field cell put

PctSuccess: Sum(IIF([Success Rates] = "Success", 1, 0))/Count(*)

If it's in a totals query you will need to use the "Expr" operator on the
Totals line.
 
J

John Spencer

In the report footer (not the page footer) you can use a control with
the following as its source.

Assumption: Your field is named SuccessRate

= Abs(Sum([SuccessRate]="Success")) / Count([SuccessRate])

How it works.
In the footer
[SuccessRate] = "Success"
will return True (-1) or False(0) for every record.

Sum will total all those -1's
Abs will remove the negative sign

Count([SuccessRate]) will count 1 for each record in the report where
[SuccessRate] has some value. So it will count both Success and Failure

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

Hi all,

I have a report and one of the columns is for success rates.

example,

Success Rates
-------------------------
Success
Success
Failure
Success
Failure

What I want to do is to find the average success rate. Can anyone help with
getting the answer?

Cheers,

Chris

What's the context? Do you want the percentage of Success over the entire
table, or is there some other field (you mention a "run") that identifies a
subset?

If it's over the entire table, create a query. In a vacant field cell put

PctSuccess: Sum(IIF([Success Rates] = "Success", 1, 0))/Count(*)

If it's in a totals query you will need to use the "Expr" operator on the
Totals line.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top