Apologies for the confusion -
I change my problem statement to the below -
- when a cost unit occurs in a subsequent series then take from the series the last
- when a cost unit line doesnt have direct following row with the same cost unit, then block it
Also updated in the main post
Regards,