Group transactions by different time ranges