Distinct - can I use it in aggregate or should I use advanced queries ?

Distinct - can I use it in aggregate or should I use advanced queries ?

I did a research before and it seems this is an old subject. Someone know if Distinct sql option  was implemented in the aggregate ?

Hi Luciano,

In fact, you don't have an explicit "Distinct" operation in Aggregates but you can achieve the same result with Group by option (depending on your use case).

In fact, whe you have a "Distinct" instruction it is recommended that you use Group by in order to understand which rows will, or will not, be shown.

If you still want to explicity use "Distinct", you should use SQL node.

Best regards.
Hi Nuno,
   if I use group by the register still appears.  If I try to apply it an error occurs in other part of the system. I need to remove duplicated ids.


Maybe in your query, the Group by clause will not work in Aggregates
In fact, the "Distinct" like behavior performed with Group by is very limited and may not be applyed to your use case.

Can you give me an example of what you are trying to achieve?
Distinct is not supported in Aggregates, it is supported in Advanced SQL... I tend to not like the "Group By" approach because it is hard to maintain. While I avoid Advanced SQL as much as I can, sometimes it really is better even if you can use an Aggregate to do the same through trickery.


I have to agree with you on this :)
Either way, I think that when possible, we should use Aggregates instead of SQL but... when Aggregates don't have what we need, we have to switch back to SQL.

Hi Justin and Nuno. I was travelling and returned today.
The idea was to use aggregate because I can use the filter to do the searches. Well, lets see what happens.

Thank you guys.
HI Guys,
  I found a workaround. When you assign the join to the tables will appear some nullIdentifiers. I had only to filter them.  Easy not ?
  Of course that this solution will depend on your table design but I liked it because is simple.


Hey ,  alternate way to distinct  a Aggregate just append aggregate   to list record and distinct that list record using  DISTINCTRECORDLIST  in  SORTRECORDLIST component.