group by with array values