Property Disjunction of 2 object sets

I am trying to find the most elegant way to do a property disjunction across 2 different object sets (of the same object types) I’ve defined in a workshop module.

E.G. Object Set 1 has the set of distinct property values for Property A [a, b, c]. Object Set 2 has the set of distinct property values for Property A [a, b, c, d]. Ideally I’d like to return the objects from Object Set 2 which contain property values for Property A not found in Object Set 1.

Is there a clever way to do this without writing a single use function for this operation?

We can do this by leveraging the Set Math features of Object Set variables in workshop.

Define Array Variable “Property A - 1” as an object set aggregation from Object Set 1. Define Object Set 2-A-1, as Object Set 2 filtered with your array variable above. Then, you can create a new variable, starting from Object Set 2, and combine with another object set. Select your recently created “Object Set 2-A-1” and then you can choose to subtract those objects from your starting object set.

Depending on your circumstance you can probably do this in fewer steps too, but that should do what you asked. Using the right combination of union, intersect, and subtract on object sets you can get precise sets pretty efficiently.

1 Like

Thanks @jschoenfeld I’ll play around with this and I think this works. I misunderstood your response at first, so I’ve edited my answer!