Trying to create dynamic item "collections" with dynamic comparison tables

Let’s say I have a database of “books” (actually something else). In addition to looking at individual pages about books, I want to be able to:

  • have a column where I tag books with “belongs to collection”
  • on each generated “collection” page, I want a table where the books in that collection can be compared according to a set of factors which DIFFERS per collection.

Example:

  • “Best horror books” is one collection, “best romance books” is another.
  • The “Best horror books” table may contain, in addition to shared factors such as “number of pages”, collection-unique factors such as “scariness” (so that’s a column in the master “books” table).
  • Likewise, “Best romance books” table might include “spiciness grade of romance scenes”, so that’s another field in the “books” table.

When I’m approaching this, I’ve started a separate “collections” table, which includes one multi-select field that says “compare fields”. But I have no idea how to create a table that looks at that field in order to know which fields to use the table.

Another problem is that I might have books that belong to several collections. When I try to filter what books to include in the table (and list) on the collection page, I would need a filter option of “includes”, but the only options are is/isn’t/is one of/is none of/is empty. So with “is” the collection ends up with only the books that belong to that collection ONLY - any books connected to multiple collections are omitted.

Anyone with an idea of how to solve this?