I have a dataset that is as indicated below. The first column is a date column, the second column comprises an id that can apply to any user (within the same department) and a given user can have multiple of these ids. The 3rd column is specific to a particular user but every so often, this id can be changed in case a user forgets it. The last column comprises of names and individuals can have similar names. I want to harmonize columns 1 and 2 prior to analysis as indicated below.
Input Dataset
| Date | Id2 | id3 | Name |
|---|---|---|---|
| 2018-01-01 | 001 | AA | Name1 |
| 2018-01-02 | 001 | AB | Name1 |
| 2018-01-01 | 001 | AC | Name1 |
| 2018-01-04 | 003 | AA | Name1 |
| 2018-01-01 | 004 | AA | Name1 |
| 2018-01-01 | 001 | AD | Name2 |
| 2018-01-04 | 002 | AE | Name3 |
| 2018-01-04 | 005 | AG | Name1 |
Desired output:
| Date | Id2 | id3 | Name |
|---|---|---|---|
| 2018-01-01 | 001 | AA | Name1 |
| 2018-01-02 | 001 | AA | Name1 |
| 2018-01-01 | 001 | AA | Name1 |
| 2018-01-04 | 001 | AA | Name1 |
| 2018-01-01 | 001 | AA | Name1 |
| 2018-01-01 | 001 | AD | Name2 |
| 2018-01-04 | 002 | AE | Name3 |
| 2018-01-04 | 005 | AG | Name1 |