Aggregate distinct

The improvement enables the user to aggregate only distinct values.