Help with loop logic, find duplicates
I have an import from a CSV with a product number and ID. I need to find the duplicates within the found set, so say if the records look like this:
I need to find the duplicates, except the first one and mark the first incident so I can export those ID's as a csv. I thought about a 'duplicate' field, then a loop to check to see if the current record Product_ID matches the previous, if so-put an 'X' in the duplicate field. If not, move to next record and check again. Maybe I'm tired, but the logic is driving me nuts.
I thought about something like this:
Set Variable [$$dup; Value:Product::ID]
Go to Recore/Request/Page [Next]
If [Product::Duplicate <> "x"]
Else If [Product::ID=$$dup]
Insert Text[Select,Product::Duplicate; "x"]
Go to Record/Request/Page[Next]
But I'm sure this wrong and not working. Any ideas?