Hi I need help to check if a collection contains duplicates of each other.
I have 1 collection "Materials"
-Wood
-Iron
-Wood
-Plastic
From a click of a button: I would like to detect that there are duplicates within the collection, in the example above it will see that wood is listed twice and is considered duplicate.
Any help is appreciated. Thank you!
I don't know what you want to do with the information, but I will show you how I would check. Group by the column(s) you are checking for duplicates of, then any group with more than one record will indicate a duplicate:
Button:
ClearCollect(
colMaterials,
["Wood","Iron","Wood","Plastic"]
);
ClearCollect(
colMaterialOccurences,
AddColumns(
GroupBy(
colMaterials,
"Value",
"ValueGroup"
),
"OccurenceCount",
CountRows(ThisRecord.ValueGroup)
)
);
Label:
"Duplicates Exist: " & !IsEmpty(Filter(colMaterialOccurences, OccurenceCount > 1))
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional