
Announcements
Hi,
I have a list that looks like this:
| Column1 | Column2 | Column3 | Column 4 |
| A | Text1 | aaa | ... |
| A | Text2 | bbb | ..... |
| A | Text3 | ccc | ... |
| B | (blank) | ddd | ... |
| C | (blank) | eee | .... |
I need to create a collection that eliminates duplicates on Column1 and keeps Column3 and 4.
Distinct() only returns one column (Column1) so I'm unsure how to proceed to add the rest of the columns...
FInal result on the example would be:
| Column1 | Column3 | Column 4 |
| A | ccc | ... |
| B | ddd | ... |
| C | eee | .... |
Additional info:
Column3 is blank if Column1 does not have duplicates. As column3 are options for column1.
When populated, Column3 has no duplicates.
Thanks and regards
The issue is the same as: https://powerusers.microsoft.com/t5/General-Discussion/how-to-remove-duplicates-from-collection/td-p/20106
but that post is 2 years old, so hope there is a solution for that now
Hi @Anonymous
Group By would be your best bet to get distinct records of Column1 and it will give you sub records which would include all the values/rows associated with Column 1 in a table
Second option would be to use the following to get the output sample you provided
ForAll(Distinct(DataSource,Column1),Collect(colNew, Last(Filter(DataSource,Column1=Result))))
ColNew would give you the result
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly