do the correct group bys depending on the date range