2403
Views
9
Comments
Solved
Distinct - can I use it in aggregate or should I use advanced queries ?
Question
I did a research before and it seems this is an old subject. Someone know if Distinct sql option  was implemented in the aggregate ?

Thanks
2014-10-08 20-03-52
Luciano Schiavo
Solution
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.

UserImage.jpg
Akeem Heshimu

How would I do this?

2025-08-08 18-54-29
Nuno Maurício
Staff
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.
2014-10-08 20-03-52
Luciano Schiavo
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.

Thanks
2025-08-08 18-54-29
Nuno Maurício
Staff
Luciano,

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?
2019-11-12 17-31-26
Justin James
 
MVP
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.

J.Ja
2025-08-08 18-54-29
Nuno Maurício
Staff
Justin, 

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.


2014-10-08 20-03-52
Luciano Schiavo
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.
2014-10-08 20-03-52
Luciano Schiavo
Solution
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.

UserImage.jpg
Akeem Heshimu

How would I do this?

2022-10-20 02-09-39
JeffT

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

Cheers,

Rocky

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.