employee group_by logic implemented