18
Views
2
Comments
Solved
Many-to-Many Aggregates
Application Type
Reactive

I have database that part of it looks like this:I need to create table on my screen with list of Tickets (TicketNumber, Title, MainUser, ListOfUsers...). ListOfUsers is Many-To-Many relationship. I created aggregate like this:

But in the result I can see duplicates.


My question is, how to remove duplicates from my table? What is the best practise?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Łukasz,

You do not have duplicate rows, I would think. You do have duplicate tickets, as for each user with such a ticket, you are selecting a ticket, so if 10 users have the same ticket, you get 10 rows for that one ticket.

So the question is, how to display the "list of users"? I have recently answered a similar question. You can either do post-processing, or use a Block that retrieves further information. In this case, I'd advise the second method. So remove TicketUsers and Users from your query, and create a Block that displays all users for a certain Ticket Id.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Łukasz,

You do not have duplicate rows, I would think. You do have duplicate tickets, as for each user with such a ticket, you are selecting a ticket, so if 10 users have the same ticket, you get 10 rows for that one ticket.

So the question is, how to display the "list of users"? I have recently answered a similar question. You can either do post-processing, or use a Block that retrieves further information. In this case, I'd advise the second method. So remove TicketUsers and Users from your query, and create a Block that displays all users for a certain Ticket Id.

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