The data I have looks like the table shown in the appendix 'Current format'. I want to come to the result shown in the appendix 'Needed result'.
So I need some form of grouping based on the ID column. And also a sorting based on the BOTTOM_DEPTH or based on the DBK column.
Within each group, the first row needs to get a top depth of zero. All following rows need to get the BOTTOM_DEPTH value of the row above.