Scenario
What counts as a duplicate?
There are three cases of duplicate records:
- Two or more records have identical values in each and every field (true duplicates).
- Two or more records have identical values in some fields, and the fields that do not have matching values are of no consequence (it does not matter which record we take).
- Two or more records have identical values in some fields, and one of the variable fields gives us a vale we can select on (in practice, usually a datetime field like 'last updated time').
Name | AddressLine1 | LastUpdatedDate | FavouriteDog |
---|---|---|---|
Andrew | 10 Gwydir St. | 01/02/2017 | Blue |
Andrew | 10 Gwydir St. | 01/02/2017 | Blue |
Name | AddressLine1 | LastUpdatedDate | FavouriteDog |
---|---|---|---|
Andrew | 10 Gwydir St. | 01/02/2017 | Blue |
Andrew | 15 Mill Road | 03/04/2018 | Red |
Step-by-step guide: Identifying Duplicate Records
- Click to select the stream that may contain duplicates.
- Right-click on the model view pane, and select 'Merge selected streams'.
- in the pipe configuration dialog that pops up, group on the field with duplicated data and click the green tick to save your input.
- in the Automatic Stream Configuration dialog that appears, select 'just key attributes' from the drop down.
- Run analysis on the stream that results. Viewing the data, it can be seen that for each value of the grouping key,
PhixFlow reports the number of records in that group, and also highlights lines where it is greater than one.
Step-by-step guide: Removing Duplicates
- Load all data (including duplicates) into a stream
- Create a new stream from this stream - make it an aggregate stream.
On the pipe linking the two streams, set the maximum number of records to be one and group it on the field with duplicated data.
OptionalIf this is case 3, apply sorting on another attribute, depending on which record you want. E.g. to get the latest record, sort by the last updated date. See 'outMult' in the screenshot below for illustration.
- Run the analysis and inspect the resultant stream data. There should now be only unique records.
Related articles
Filter by label
There are no items with the selected labels at this time.