Hi all,
I need a help to elaborate this logic.
I have three columns "UNIT", "Status" and "Operation".
I would like to compare the "UNIT", and it there is a repeated UNIT id compare the "Operation" digits on the left "_" and if there is equal values then attribute the "Operation" value from the "OK" in the place of the "Operation" value from the "Measure" status.
ORIGINAL TABLE
Original table | |||
UNIT | Status | Operation | Comment |
C1357 | OK | 30_3 | For the status "OK" the correct operation number is correct |
B2678 | OK | 10_1 | |
A7534 | OK | 20_2 | |
C1357 | Measure | 30_1 | When the status is measure it should assume the OK status "Operation" value by comparing the digits on the left from the "_". In this case is "UNIT" is repeated and the OK status "Operation" is 30_3. It should be 30_3 |
C1357 | OK | 40_4 |
DESIRED TABLE
UNIT | Status | Operation |
C1357 | OK | 30_3 |
B2678 | OK | 10_1 |
A7534 | OK | 20_2 |
C1357 | Measure | 30_3 |
C1357 | OK | 40_4 |
I hope that someone can help me on it.
Many thanks,
Wilson
Solved! Go to Solution.
Hi @DawnDuong ! Thank you very much for your solution. It solved my problem. 🙂