In reply to KT.

Yes. Look at the UNIQUEBY function, which enables you to group by multiple variables.