Help iterating through elements of a set

Hello all,

I am trying to figure out a way to iterate through elements of a set to get even more granular results. Below, I have made a set of AD sites that contain more than 1 endpoint but do not have a local relay. I am trying to iterate through the AD sites (elements) to also report the number of devices at these sites. I’m relatively new to session relevance, so I’m unclear of its full capabilities. Is what I’m looking to achieve possible?

elements of
    (
      set of (unique values whose (multiplicity of it > 1) of values of results from (bes property "AD Site") of  bes computers) 
      -
      set of (unique values of (values of results from (bes property "AD Site") of it) of bes computers whose (value of results from (bes property "BES Relay Service Installed") of it as lowercase contains "yes -"))
    )

You could do:

number of elements of ...

but I’m not sure that is what you are looking for.

Number of elements will just return the number of AD Sites in the grouping. I’m looking for the number of machines per AD Site in the set.

This is related: https://bigfix.me/relevance/details/3000115