I’m having trouble trying to de-duplicate records. My data is as follows:
ID - AccountId - ContactId - CreatedDATE
1 - 100 - 1000 - 2017/11/25
2 - 100 - 1000 - 2016/07/29
3 - 200 - 2000 - 2015/12/25
4 - 200 - 2000 - 2012/01/01
5 - 300 - 3000 - 2010/09/15
6 - 300 - 3000 - 2019/05/15
7 - 300 - 3000 - 2018/03/25
8 - 400 - 4000 - 2010/01/05
9 - 400 - 4000 - 2011/01/05
10 - 400 - 4000 - 2019/01/05
11 - 400 - 4000 - 2014/01/05
I want to remove duplicate AccountId
and ContactId
records and want to retain the the record from the duplicate with the latest CreatedDate
.
Essentially, from this sample data set I only want to keep records with ID
as 1, 3, 6 and 10 (duplicate removed and retains latest createddate
).
I’ve made a few attempts but am having trouble. Looking for suggestions.