1
 Follower
11
 Likes

Aggregate: Count Distinct

Aggregates & Queries
On our radar
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.
Created on 9 Mar 2015
Comments (3)
Hello,

You can use GROUP BY on COLUMN and then outside the aggregate use:
<AGGREGATA_NAME>..List.Length

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

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


Hi Carlos,

Can I merge this with this idea?
https://www.outsystems.com/ideas/2179/aggregate-with-distinct

It is also about having the distinct capability in Aggregates.

Cheers,


views
884
Followers
1