Here is some dummy data from a dataset I am working with:
| Row | Col1 | Col2 | Col3 | Col4 | Amt |
1 | 11234 | 12 | 687 | 11 | 0 |
| 2 | 14567 | 16 | 5333 | 12 | 0 |
| 3 | 54321 | 31 | 205 | 01 | 250 |
| 4 | 17890 | 16 | 123 | 01 | 100 |
| 5 | 54321 | 31 | 207 | 02 | 250 |
| 6 | 99876 | 31 | 209 | 12 | 0 |
In the above example, I am needing to compare rows that match based on Col1.
The logic I am trying to build is:
if the values in Col1 match AND their corresponding values in Col3 are = 205 or 207, then I need to keep the row with the '207' in Col3 and delete the other row with '205' in Col3.
In the above sample data, rows 3 & 5 have the same value in Col1 and their corresponding values in Col3 are 205 and 207. As a result, I need to delete row 3 from the dataset and keep row 5, along with the rest of the dataset.
Having some issues getting this to work, and would love for some ideas about how to solve this.
Thanks!