I rethought through the issue, and came up with a totally methodology. This code will work for wafers
Names Default To Here( 1 );
dt = Current Data Table();
// Summarize the data to find the maximum :ts for each wafer/rowcol
dtSum = dt << Summary(
Group( :wafer_number, :RowCol ),
Max( :ts ),
Freq( "None" ),
Weight( "None" ),
statistics column name format( "column" ),
link to original table( 0 )
);
// Join the data together matching only where the max :ts for each
// wafer/rowcol
dtFinal = dt << Join(
With( dtSum ),
Merge Same Name Columns,
By Matching Columns( :wafer_number = :wafer_number, :RowCol = :RowCol, :ts = :ts ),
Drop multiples( 0, 0 ),
Include Nonmatches( 1, 0 ),
Preserve main table order( 1 )
);
dtSum << delete columns("N Rows");
Close( dtSum, nosave );
// Delete all rows that do not match the maximum value of :ts within
// each Wafer, RowCol
dtFinal << select where( Not( :Match Flag == 3 ) );
dtFinal << delete rows;
// Get rid of the Match Flag column which is an artifact of the Join
dtFinal << delete columns("Match Flag");
Jim