comparing column data and add if not present
I have the following data:
Order Group 1 Group 2 Group 2 Group 2 |Target1 Target2
782187 PRT |EQP
782679 BPR | BPR
783014 EQP PRT |EQP
783016 EQP PRT |EQP
I would like to check each line and where group1 has a value, check to see
if that value is in the target columns; it could be target1, 2, 3, 4. If it
does exist then do nothing. If it doesn't exist then bring it over into ONE
of the empty columns under either group 1-5 BUT it must not over write an
existing value and it must have a unique value. So the output for this
example would be.
Order Group 1 Group 2 Group 2 Group 2 |Target1 Target2
782187 PRT EQP |EQP
782679 BPR | BPR
783014 EQP PRT |EQP
783016 EQP PRT |EQP
You noticed I only added "EQP to the top line, the others were OK, because
it already had the within the set. I have a few idea's brewing but I thought
I would give the experts a shout to see who finishes first - smile.
|