Let see if this works for you. I've replaced the Regex() with ListItem() so that you can extend this (in case any item has more keywords than Regex() can support).
Add this to your Set rules for file display (not, if you are already using v_tracks_keyword there, you should replace v_tracks_ in all the code below with something unique, such as v_nratedtracks_):
[=1save(0, v_tracks_listitem([keywords], 0))save(0, v_tracks_listitem([keywords], 1))save(0, v_tracks_listitem([keywords], 2))save(0, v_tracks_listitem([keywords], 3))]=1 [=1save( 0,v_kwrsum_listitem([keywords],0))save( 0,v_kwrsum_listitem([keywords],1))save( 0,v_kwrsum_listitem([keywords],2))save( 0,v_kwrsum_listitem([keywords],3)))]=1 [=1ifelse(compare([rating],>,0), ifelse(!isempty(listitem([keywords], 0)), save(math(1+load(v_tracks_listitem([keywords], 0))),v_tracks_listitem([keywords], 0)))ifelse(!isempty(listitem([keywords], 1)), save(math(1+load(v_tracks_listitem([keywords], 1))),v_tracks_listitem([keywords], 1)))ifelse(!isempty(listitem([keywords], 2)), save(math(1+load(v_tracks_listitem([keywords], 2))),v_tracks_listitem([keywords], 2)))ifelse(!isempty(listitem([keywords], 3)), save(math(1+load(v_tracks_listitem([keywords], 3))),v_tracks_listitem([keywords], 3))))]=1 [=1save(math([rating]+load(v_kwrsum_listitem([keywords], 0))),v_kwrsum_listitem([keywords], 0))save(math([rating]+load(v_kwrsum_listitem([keywords], 1))),v_kwrsum_listitem([keywords], 1))save(math([rating]+load(v_kwrsum_listitem([keywords], 2))),v_kwrsum_listitem([keywords], 2))save(math([rating]+load(v_kwrsum_listitem([keywords], 3))),v_kwrsum_listitem([keywords], 3))]=1
The code above split apart for readability follows. This initializes the number of tracks per keyword to 0:
[=1
save(0, v_tracks_listitem([keywords], 0))
save(0, v_tracks_listitem([keywords], 1))
save(0, v_tracks_listitem([keywords], 2))
save(0, v_tracks_listitem([keywords], 3))
]=1
and then initializes the keyword rating sum per keyword to 0:
[=1
save(0,v_kwrsum_listitem([keywords],0))
save(0,v_kwrsum_listitem([keywords],1))
save(0,v_kwrsum_listitem([keywords],2))
save(0,v_kwrsum_listitem([keywords],3)))
]=1
and if Rating is non-zero, increments the per keyword track count:
[=1
ifelse(compare([rating],>,0),
ifelse(!isempty(listitem([keywords], 0)), save(math(1+load(v_tracks_listitem([keywords], 0))),v_tracks_listitem([keywords], 0)))
ifelse(!isempty(listitem([keywords], 1)), save(math(1+load(v_tracks_listitem([keywords], 1))),v_tracks_listitem([keywords], 1)))
ifelse(!isempty(listitem([keywords], 2)), save(math(1+load(v_tracks_listitem([keywords], 2))),v_tracks_listitem([keywords], 2)))
ifelse(!isempty(listitem([keywords], 3)), save(math(1+load(v_tracks_listitem([keywords], 3))),v_tracks_listitem([keywords], 3))))
]=1
and finally, adds the Rating value to the keyword rating sum per keyword (our per-keyword accumulator):
[=1
save(math([rating]+load(v_kwrsum_listitem([keywords], 0))),v_kwrsum_listitem([keywords], 0))
save(math([rating]+load(v_kwrsum_listitem([keywords], 1))),v_kwrsum_listitem([keywords], 1))
save(math([rating]+load(v_kwrsum_listitem([keywords], 2))),v_kwrsum_listitem([keywords], 2))
save(math([rating]+load(v_kwrsum_listitem([keywords], 3))),v_kwrsum_listitem([keywords], 3))
]=1
Now, you create some expression columns. This one will show the per-keyword total rating:
load(v_kwrsum_listitem([keywords], 0)) : /
load(v_kwrsum_listitem([keywords], 1)) : /
load(v_kwrsum_listitem([keywords], 2)) : /
load(v_kwrsum_listitem([keywords], 3))
and this one will show the per-keyword rating averages:
listbuild(0, / :/ ,
ifelse(!isempty(listitem([keywords],0)), math(load(v_kwrsum_listitem([keywords], 0)) // load(v_tracks_listitem([keywords], 0)))),
ifelse(!isempty(listitem([keywords],1)), math(load(v_kwrsum_listitem([keywords], 1)) // load(v_tracks_listitem([keywords], 1)))),
ifelse(!isempty(listitem([keywords],2)), math(load(v_kwrsum_listitem([keywords], 2)) // load(v_tracks_listitem([keywords], 2)))),
ifelse(!isempty(listitem([keywords],3)), math(load(v_kwrsum_listitem([keywords], 3)) // load(v_tracks_listitem([keywords], 3))))
)
With all the code above, you can just copy/paste a line from each fragment, and change the index to add more keywords.