Here is a little script that calculates the new columns you want
Names Default To Here( 1 );
dt = Current Data Table();
dt << New Column( "Calculated Status",
character,
set each value(
If(
:Test 1 || :Test 2 == "PP", "PASS",
:Test 1 || :Test 2 == "FF", "SAME",
"DIFF"
)
)
);
If( Try( dt:cellNum << get name, "" ) == "",
dt << New Column( "cellNum" )
);
dt:cellNum << set each value( Num( :CELL ) );
dt << New Column( "Calculated Distance",
set each value(
If( :Calculated Status == "DIFF",
currLot = :LOT;
cells = dt:cellNum[dt <<
get rows where(
:LOT == currLot & :Calculated Status == "SAME"
)];
dif = Min( Abs( Num( :CELL ) - cells ) );
,
dif = .
)
)
);
dt << delete columns( "cellNum" );
Jim