Below is a screenshot I have of a sample MySQL attendance data for users.
Each attendance for username is calculated based on column attended_sessions divide by total_sessions multiple by 100. This gives each users exact attendance. Each user has variable total number of sessions depending on when they started and ended.
This is fine. However my question is to calculate the attendance for all of those users, and this poses a maths dilemma.
If I average all 15 rows of the attendance percentage I get 87.09%. However, this is average. Whereas if I sum up both the sessions data I get attended_sessions=1494 and total_session=1648. Then if I divide that by each other and multiply by 100 I get 90.66%.
My maths skills isn't great. So which is the correct method to calculate? I would think that the average isn't accurate as it is averaging it. Whereas the other method of summing up all sessions would be the exact representation of the attendance.
