35% = 1000
This represents customers five star rating system, where averaged 5 star rating will equal 1000 which equals 35% of grade
15% = 2000
This represents number of calls made, where 2000 calls made will equal 15% of grade but any more calls after that will be of no effect to grade
30% = 100
This represents a percentage to a set goal, where 100% means they have achieve the set goal or target which is 30% of their grade
10% = 90
This represents a time factor (90 days maximum), where for everyday on task it adds to the grade. 90 days on task will represent 10% of grade
5% = 100
for every new customer enrolled, (100 customers maximum) adds up to 5% of grade
5% = 3120
This is a pass or fail background check grade, where pass give five percent of grade and fail get no 5% of grade.
The normal weighted average calculation = 850
(35Ă—1000+15Ă—2000+30Ă—100+10Ă—90+5Ă—100+5Ă—3120) / (35+15+30+10+5+5) = 850
This code puts 1000 into the key “35”, 2000 into the key “15”, etc. Except until you get to the end. It puts 100 into the key 5, and then puts 3120 into the key 5, meaning the 100 disappears and you do not get a second entry for 5.
There are a couple of ways to work around it. To use megazoid’s own code as a basis, here’s what I would do.