Hello All,
I have got source data in following way:
Col_1 | Col_2
100 | 2000
100 | 3000
100 | 4000
300 | 5000
300 | 6000
300 | 7000
I need to generate an extra column as Col_3 (based upon Col_2) where it contains the value from previos row, starting from 0 for every group based on Col_1. The outcome expected as:
Col_1 | Col_2 | Col_3
100 | 2000 | 0
100 | 3000 | 2000
100 | 4000 | 3000
↧