I need help creating an overall average in Report Builder 3.0. I have a query that returns data in the following format:
Major Num Of Students Max GPA Min GPA Avg GPA
---------- ------------------ ---------- ---------- -----------
Accounting 89 4.0 2.3 3.68
Business 107 4.0 2.13 3.23
CIS 85 3.98 2.53 3.75
I added a total row in Report Builder that shows the sum number of students, overall Max GPA, and overall Min GPA. But I can't simply run the Avg
function on the Avg GPA column, as it needs to take into account the number of students for an overall average. I believe that I need to do something like the following (in pseudocode):
foreach ( row in rows ) {
totalGpa += row.numOfStudents * row.avgGpa
totalStudents += row.numOfStudents
}
overallAvgGpa = totalGpa / totalStudents
Does anyone know how I could do this in my report?