I have very limited coding experience with JSL and can do with some help to solve this problem. Basically, I have alternating rows of when tools are down and up and wanted to transfer/move the up time to a new column under the down time and compute the difference. I have attached two tables--this1 which is current data I have and this2 is the desired output.
Basically, transform from this:
to this:
Create new columns named: "txn_up_date" and "comment_up"
Loop through the each row and do the following:
Check if the first occurrence of a tool is "Up" under "new_availability" ;
if yes, delete the row and continue the loop
otherwise, check if the same tool has a succeeding row with a "Up" status under "new availability" column
if yes, do the following:
- a. Transfer both the "txn_date" and "comment" of the succeeding row (i.e."Up" in new_availability column) to the preceding row's newly created "txn_up_date" and "comment_up" columns respectively.
- b. Then keep the preceding role but delete the succeeding one which just got some of its contents transferred. if no; delete the row.