I'm sorry for the vague thread title, but I wasn't sure how to summarise this. An admin can feel free to edit the title accordingly if they figure a better one for me.
So, I just created three new library fields: [Album Genre], [Album Subgenre], and [Album Style]. Naturally, these correspond to the normal [Genre], [Subgenre], and [Style (modified)] fields (the latter two of which, themselves, being custom fields created by me for my own purposes). As you can imagine, the "album" fields are meant to represent the overall genre, subgenre, and style leanings of an entire given album. The non-"album" fields are meant to represent the genres, subgenres, and styles of specific tracks.
Currently, all six of these fields are of the "List (semicolon delimited)" type, but I had wondered if I could go one better and make the three "album" fields expression fields that depend on the data in the other three fields, as well as other album information. To simplify my explanation of this, let me put it in an if/then statement:
For [Album Subgenre] (as an example), I want the expression to translate into this:
If greater than {percentage} of the tracks in [Album] contain {subgenre} in the [Subgenre] field, then add {subgenre} to [Album Subgenre].
Here's where things get really complex:
Since [Subgenre] is a "List (semicolon delimited)" field, there may be multiple subgenres in any given track. Therefore, I need the expression for [Album Subgenre] to be able to look at the [Subgenre] field and add only those items which appear in or above a specified percentage of the album's total tracks to itself, separated again by semicolons (preferably in alphabetical order). Thing is, I have no idea how to tie the [Album Subgenre] field dynamically to both the [Album] and [Subgenre] fields while taking into account how many tracks are in the album.
As a real example, I just went through and tagged Agalloch The Serpent & the Sphere. The first track, "Birth and Death of the Pillars of Creation", is the only track on the album that falls into the "funeral doom metal" genre. There are nine tracks on the album in total, so "funeral doom metal" should not be added to the [Album Subgenre] field (because "funeral doom metal" only describes that one track, and not the album as a whole). However, regular "doom metal" and "neofolk" appear consistently through the album's other eight tracks. Therefore, those subgenres should be replicated and added automatically to the [Album Subgenre] field.
I hope this makes sense. I feel like it's a real longshot that it'd be possible to implement reliably, but I figure it wouldn't hurt to ask.