@helge @kharrison Haven’t tried it but if you generate a predicate for each case in your enum - then could you could loop over them and AND or OR them together like this?

var predicate = query.first.predicate
for subQuery in query.dropFirst {
predicate = { predicate && subQuery.predicate }
}