This may be a long shot, so bear with me.
I have a query that returns a list of catagores (text strings) and a count of the number of times they occur:
Order Request,7842 Request,3976 Other,3247 ...
SELECT Category__c, Count(Id) FROM Case WHERE CreatedDate = LAST_MONTH GROUP BY ROLLUP (Category__c)
It's working fine, however I need the data to be filtered more and currently have Perl script doing the job. I have a list of categories (about ~10 out of a total of ~16) of which the occurrences should be counted, and all occurrences of the other categories should dump into the "Other" category.
The script also organizes the final categories into a list in a specific order.
Is there any way to do this within the query rather than further processing the data with a script?
EX: The perl script takes data like the following:
Category1, 4 Category2, 6 Category3, 8 Category4, 2 Other, 7
And will re format it by combining certain categories into the "Other" category and ordering them in a certain way:
Category3, 8 Category1, 4 Other, 15