Group by in variant type