I have a table listing faults on rolls of material and need to work out the distance between faults on the same roll and create a new table with the results.
Current table
Batch Roll Fault_Str Fault_end
8701 1 2 3
8701 1 6 8
8701 1 10 14
8701 2 5 7
8701 4 3 4
8701 4 6 7
I need to subtract fault_end of the first fault (3) on Roll 1 from Fault_str (6) on second fault from Roll 1 and so on to create the new table below.
Batch Roll Distance (= Fault_Str - Fault_end)
8701 1 3 (= 6 - 3)
8701 1 2 (= 10 - 8)
8701 2 0 (No 2nd fault on Roll 2)
8701 4 2 (= 6 - 4)
Any help on this will be greatly appreciated.
Current table
Batch Roll Fault_Str Fault_end
8701 1 2 3
8701 1 6 8
8701 1 10 14
8701 2 5 7
8701 4 3 4
8701 4 6 7
I need to subtract fault_end of the first fault (3) on Roll 1 from Fault_str (6) on second fault from Roll 1 and so on to create the new table below.
Batch Roll Distance (= Fault_Str - Fault_end)
8701 1 3 (= 6 - 3)
8701 1 2 (= 10 - 8)
8701 2 0 (No 2nd fault on Roll 2)
8701 4 2 (= 6 - 4)
Any help on this will be greatly appreciated.