Aggregate two groups on same collection

I don’t see how the sample data above gives the result you posted, unless I’m being stupid (which isn’t the first time and won’t be the last…)

Can you post your SQL that you normally do this with as that’ll be a concrete definition.