How to get distinct value in a record list using filter

Hi everyone! I am having an issue regarding duplicate record. Any idea on how to only get 1 record out of these duplicate using filter? Thanks! 

mvp_badge
MVP
Solution

Hi Richard,

You could use Group By on one of the Project attributes to get unique records, but there could be a better way to rewrite your Aggregate and ensure it only returns what you need. Could you show us more of it? Entities, joins and current filters would help us give you more solutions.

Richard Repolona wrote:

Hi everyone! I am having an issue regarding duplicate record. Any idea on how to only get 1 record out of these duplicate using filter? Thanks! 

Hi Richard,

Try to use ListDistinct system action to filter duplicate elements.

Regards

seema


mvp_badge
MVP
Solution

Hi Richard,

You could use Group By on one of the Project attributes to get unique records, but there could be a better way to rewrite your Aggregate and ensure it only returns what you need. Could you show us more of it? Entities, joins and current filters would help us give you more solutions.

Hi,

The other option is "White your own SQL Query"!

"The SQL SQL element allows you to execute, test, and review custom SQL queries in your applications. The element provides flexibility in data manipulation, but we recommend using Aggregates when applicable. Aggregates are highly optimized and easier to maintain."

For more details, see https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Query_Data/SQL_Queries.


Best Regards,

Wilbert Carpi !!!

Typically this is caused when a join is missing or not implemented correctly. Recheck your joins to make sure they're working properly.

Hi Richard,

use the SQL element for best result, in this case use distinct. Other way is using group by on aggregate.

I preffer use the SQL element and write the query for this.

Regards.

Thanks everyone! Done it using groupby :)

There is a better solution my friend :


use group by in aggregate you will keep the current database and keep performance at the same time, creating a duplicate list will flood the system performance if we talk about big data .

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