Here is a sample data table and a simple script that will adjust the time when the step changes. The script first displays the data table for 10 seconds, so you can see what the original table looks like, and then it goes ahead and runs the little script to adjust the time values.
Names Default To Here( 1 );
dt = New Table( "example",
Add Rows( 42 ),
New Column( "time",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
)
),
New Column( "Step",
Character,
"Nominal",
Set Values(
{"Step1", "Step1", "Step1", "Step1", "Step1", "Step1", "Step1", "Step1",
"Step2", "Step2", "Step2", "Step2", "Step2", "Step2", "Step2", "Step2",
"Step2", "Step2", "Step2", "Step2", "Step2", "Step3", "Step3", "Step3",
"Step3", "Step3", "Step3", "Step3", "Step3", "Step3", "Step3", "Step3",
"Step3", "Step3", "Step3", "Step3", "Step3", "Step3", "Step3", "Step3",
"Step3", "Step3"}
)
)
);
wait(10);
For Each Row(
If( Row() == 1,
adder = 0,
If( Lag( :step ) != :step,
adder = :time[Row() - 1]
)
);
:time = :time + adder;
);
Jim