calculating by week and by_hour