Aggregate: Count Distinct

By Carlos Henriques on 9 Mar 2015
The count operation just does COUNT(COLUMN).
In some situations we need to do a count distinct like COUNT(DISTINCT COLUMN).

With this limitation Advanced Query is still the solution to simple operations like a count.
Tiago Lopes10 Apr 2015

You can use GROUP BY on COLUMN and then outside the aggregate use:

The platform will optimze the code in order to get only the Length attribute of the Aggregate instead of load the entire result list.

John Williams6 Dec 2016

Agreed Count( Distinct would be very useful and eliminate the need for some advanced queries on complex joins or having to do lookup function to perform a count

Vasco Pessanha26 Jan (4 weeks ago)

Hi Carlos,

Can I merge this with this idea?

It is also about having the distinct capability in Aggregates.