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!

Wieghted Averages

Status
Not open for further replies.

PatBradley

Programmer
Aug 9, 2002
10
US
I have an audit report where I start with a possible score of 100
If an audit question answer is equal to N/A I need to subtract that questions point value from the possible 100
If more then one question has N/A for an answer then I need to sum those questions point value together and subtract that from 100.

In short:
X=100
Y=0
If Questions 1 thru 25 = N/A then Y = the sum of those questions
Final result = X-Y

Any takers?
 
Is this report grouped somehow? Sample data and a layout would help.

You can create a formula that would return the point value for questions that have an answer of "N/A":

//@N/A Answers
if {table.answer} = "N/A" then
{table.points}
else
0

You then need to create another formula for the grouping or the Grand total so that you can subtract the N/A points from 100. Make sure you only use tha appropriate statement below:

//@Display
100 - sum({@NN/A Answers}) //use this line only if this is for a grand total and place the formula in Report Footer
100 - sum({@NN/A Answers},{table.grooupfield}) //use this line only if this is for a group total and place the formula in that Group Footer

~Brian
 
Thanks Bdreed35

This data is actually on the detail level and grouped by reviewee.
I don't want to penalize them if a question is not applicable to them.

Here's a sample of what the last developer had to determine the possible score for each audit. a reviewee can have multiple audits.
There are 729 lines of code. I need to fix that.

if({@Q3} = 3) then 100 -3
else if ({@Q3} = 3 and @Q4 = 3) then 100 -7
they touched every question scenario.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top