Would it be possible for you to provide some sample data, and the expected output from it? It will make it easy to suggest the appropriate solution.
I would but unfortunately I can't. The data is sensitive info and was supplied to me already aggregated. I'm not familiar with how to aggregate data so I can't complete the process myself.
Disd you try using this:
If ATTR( [Category] )= XXX
ELSEIF ATTR( [Category] )= YYY