if you are looping over a data table's rows (usually I would try to avoid it and use formula or set each value) I would suggest using For Each Row() instead of For(). Without having example data I would guess that the issue could be that you will get 0 as row number, which isn't valid in JMP (Invalid Row Number at row 2 in access or evaluation of ':Operation Start Date_[ /*###*/x - 1]' , :Operation Start Date_[/*###*/x - 1])
Try setting x values manually and seeing what you get, add debug prints and take a look at log
Here is example script with couple of optional ideas on how you could set bouge pas columns values
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(3),
New Column("Actual Finish Date_", Numeric, "Continuous", Format("Best", 12), Set Values([1, 4, 6])),
New Column("Actual Execution Start Date_", Numeric, "Continuous", Format("Best", 12), Set Values([0, 2, 3])),
New Column("Operation Start Date_", Numeric, "Continuous", Format("Best", 12), Set Values([10, 21, 32])),
New Column("Operation Due Date_", Numeric, "Continuous", Format("Best", 12), Set Values([11, 22, 33])),
New Column("bouge pas", Numeric, "Continuous")
);
For(x = 1, x <= N Rows(dt), x++,
If(Is Missing(Column(dt, "Actual Finish Date_")[x]),
Column(dt, "bouge pas")[x] = Column(dt, "Operation Due Date_")[x] - :Operation Start Date_[x - 1],
Column(dt, "bouge pas")[x] = Column(dt, "Actual Finish Date_")[x] - :Actual Execution Start Date_[x]
);
);
/* better option in my opinion
For Each Row(dt,
If(Is Missing(:"Actual Finish Date_"n),
:"bouge pas"n = :"Operation Due Date_"n - :Operation Start Date_[Row() - 1],
"bouge pas"n = :"Actual Finish Date_"n - :Actual Execution Start Date_
);
);
*/
/* usually best option
Column(dt, "bouge pas") << Set Each Value(
If(Is Missing(:"Actual Finish Date_"n),
:"Operation Due Date_"n - :Operation Start Date_[Row() - 1],
:"Actual Finish Date_"n - :Actual Execution Start Date_
);
);
*/
-Jarmo