SQL - Weighted Average
An average in which each quantity to be averaged is assigned a weight. These weightings determine the relative importance of each quantity on the average. Weightings are the equivalent of having that many like items with the same value involved in the average.
Averages of occupancies are usually done by Weighted Averages which are more accurate because it takes the TOTAL ROOMS of all the rows divided by the TOTAL ROOMS SOLD of all the rows.
Rooms Sold | Rooms Avail | OCC |
---|---|---|
10 | 90 | 11% |
10 | 90 | 11% |
80 | 90 | 89% |
1 | 90 | 01% |
101 | 360 | AVG vs WAVG |
The Average for the Occupy is (11+11+89+1) / 4
SUBTOTAL AVG(3)
The Weighted Average for the Occupancy is 101 / 360
WAVG(3:1:2)
A Weighted Average is more accurate because the calculation is against the totals versus averaging the OCC column.