Hi Fredrik, I think we're getting closer to me asking the correct question 🙂 Answer to your question: For the first table, why is the value for 0='1' and not '4'? Resulting tables max = 0 max = 1 max = 2 Total 1 2 1 The first value at max=0 is 1, because for only one ID the max(coded_answers)=0 over all selected rows. Therefore, the values in this table are a count, and do not refer to a specific ID. The other resulting tables are also counts of distinct ID. Cat A is in all 4 IDs and therefore there are 4 counts, but Cat E is only in one ID, and therefore there is only 1 count. I'm looking for the way to first aggregate to the max per ID, and then distinct count the IDs per categorized max (in this example, the values being 0, 1 or 2). It should do so dynamically, based on the grouping/slicing at hand. Regards, Tjalle
... View more