Hello,
I have been trying to get this particular output form my data,have tried to use the multi row but did not get very far with it. Hoping someone can advice on a better approach or logic?
for the same master_id , when the field 'type' is a 'correction' and the pay field has not changed then I want to delete the second row, as it has not changed the transaction. However I want to populate the column date2 with the correction date. And when there is no change in the two rows leave it as it is, Please example below.
what my data looks like:
| pay | master_id | type | date | date2 |
| 200 | 12 | new | 5/11/2020 12:20 | |
| 200 | 12 | correction | 5/11/2020 12:24 | |
| 100 | 11 | new | 8/11/2020 10:24 | |
| 400 | 11 | correction | 8/11/2020 10:45 | |
what i want to achieve:
| pay | master_id | type | date | date2 |
| 200 | 12 | new | 5/11/2020 12:20 | 5/11/2020 12:24 |
| 100 | 11 | new | 8/11/2020 10:24 | |
| 400 | 11 | correction | 8/11/2020 10:45 | |