appropriate operation performed for aggregating stats for date grouping and pie charts