That's the idea, but it does more than what you were asking. Here is search expression to use in Set rules for file display for the view:
[=1save(0,v_ntracks_AlbumKey())]=1 [=1save(0,v_rating_AlbumKey())]=1 [=1ifelse(!isempty([Rating]),saveadd(v_ntracks_AlbumKey(), 1))]=1 [=1ifelse(!isempty([Rating]),saveadd(v_rating_AlbumKey(), [Rating]))]=1 ~sort=[Disc #],[Track #]
Here is a Panes column expression or Category expression to use:
save(math(load(v_rating_AlbumKey()) / load(v_ntracks_AlbumKey())),avgrating)/
ifelse(
Compare([avgrating], <=, 0.5), 0.0 - 0.5,
Compare([avgrating], <=, 1.0), <0.5 - 1.0,
Compare([avgrating], <=, 1.5), <1.0 - 1.5,
Compare([avgrating], <=, 2.0), <1.5 - 2.0,
Compare([avgrating], <=, 2.5), <2.0 - 2.5,
Compare([avgrating], <=, 3.0), <2.5 - 3.0,
Compare([avgrating], <=, 3.5), <3.0 - 3.5,
Compare([avgrating], <=, 4.0), <3.5 - 4.0,
Compare([avgrating], <=, 4.5), <4.0 - 4.5,
Compare([avgrating], <=, 5.0), <4.5 - 5.0,
1, Other
)
The number of tracks per album is stored in the global variable v_ntracks_AlbumKey() and the cumulative rating for the album is stored in v_rating_AlbumKey(). The math() expression does the averaging:
math(load(v_rating_AlbumKey()) / load(v_ntracks_AlbumKey()))