I have a field called "Step Number" and would like to determine the previous step. There are two tables: Work Order Step (WOS) & Route Steps (RS).
I would like to state something along these lines:
- Take the "Step Number" and subtract 1.
- Continue subtracting 1 until the Step Number from WOS is equal to a value in RS
- Return the value which stopped the formula
Code I have tried:
do ToNumber({WO3_WorkOrderOperationDetail.StepNumber})-1 while Not(ToNumber({WO3_WorkOrderOperationDetail.StepNumber})= ToNumber({WO_97_UDF_WORoutingLines.StepNumber}))
Also have tried to do a "result" at the end, but this is not my forte and I'm not sure what to do.