get totals for categories