Adds a missing field in the group by of the export query