I have the input with the key column where the key gets changed when there is change in header (Basically a tree data). Output from the xml parse data. What I need is whenever there is a change as specific criteria the row value should update in the new column.
Sample Input data ( Please note that this is only few sample rows, I have huge data like this)
| Key | Desc | Val |
| 001 | ABCD | T |
| 001 | sfsd | 0 |
| 001 | sadfsd | 123 |
| 001 | xzcvsdfg | 345 |
| 002,003 | wertert | sdfs |
| 002,004 | sfgsfd | 133 |
| 002,005 | ertre | 456 |
| 002,005,006 | xvbx | 222 |
| 002,005,006,007 | qwrhd | dfhdg |
| 002,005,008 | sfasdf | 243 |
| 002,005,008,009 | sfsda | 345345 |
| 002,005,008,010 | sdfsdfg | 23434 |
| 002,005,008,011 | dfsgsdf | 54766 |
| 002,005,008,012 | sdfgsdf | 123 |
| 002,013 | sdgdfdh | 4567 |
| 002,014 | sdgsd | ggg |
| 002,015 | mhdtysd | btjddfgh |
| 002,015,016 | bstysr | 3453456 |
| 002,015,017 | bsdffd | 3456 |
| 002,015,017,018 | bdfsd | tert |
| 002,015,019 | sdbh | sethst |
| 002,015,020 | sdfshd | ss33543 |
| 002,015,021 | sfbsdb | 456456 |
| 002,015,021,022 | sdbdf | 346 |
| 002,015,021,023 | sfgsfd | sfgsdfg |
| 002,015,021,024 | sfsgdfg | sdfsdfg |
| 002,015,021,025 | sdfgsdfg | sfdf |
I need output like this
| Key | Desc | Val | Att( Desired Output) |
| 001 | ABCD | T | 001 |
| 001 | sfsd | 0 | |
| 001 | sadfsd | 123 | |
| 001 | xzcvsdfg | 345 | |
| 002,003 | wertert | sdfs | wertert |
| 002,004 | sfgsfd | 133 | sfgsfd |
| 002,005 | ertre | 456 | ertre |
| 002,005,006 | xvbx | 222 | xvbx |
| 002,005,006,007 | qwrhd | dfhdg | |
| 002,005,008 | sfasdf | 243 | sfasdf |
| 002,005,008,009 | sfsda | 345345 | |
| 002,005,008,010 | sdfsdfg | 23434 | |
| 002,005,008,011 | dfsgsdf | 54766 | |
| 002,005,008,012 | sdfgsdf | 123 | |
| 002,013 | sdgdfdh | 4567 | sdgdfdh |
| 002,014 | sdgsd | ggg | sdgsd |
| 002,015 | mhdtysd | btjddfgh | mhdtysd |
| 002,015,016 | bstysr | 3453456 | |
| 002,015,017 | bsdffd | 3456 | |
| 002,015,017,018 | bdfsd | tert | bdfsd |
| 002,015,019 | sdbh | sethst | sdbh |
| 002,015,020 | sdfshd | ss33543 | sdfshd |
| 002,015,021 | sfbsdb | 456456 | sfbsdb |
| 002,015,021,022 | sdbdf | 346 | |
| 002,015,021,023 | sfgsfd | sfgsdfg | |
| 002,015,021,024 | sfsgdfg | sdfsdfg | |
| 002,015,021,025 | sdfgsdfg | sfdf | |
So wherever there is change in value other than the data which falls under that tree needs to be outputed in to the new column.