Thank you again. Subsetting did improve the performance on my real (large) table. Improved solution posted below. I had thought about this before, but obviously needed a short break to get there. What I hadn't even considered though was building a list of columns and iteratively removing items. Thank you also for that!
Names Default To Here( 1 );
// new table required for example
dt = New Table( "Results (absolute & relative) vs time",
Add Rows( 8 ),
New Column( "time",
Numeric,
Set Values( [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3] ),
),
New Column( "Y1_absolute",
Numeric,
Set Values( [7, 8, 1, 9, 0.2, 0.4, 0.65, 0.98, 0.7, ., 0.83, 0.4] ),
),
New Column( "Y1-relative",
Numeric,
Set Values( [100, 114, 14, 129, ., 200, 325, 490, 100, 330, 540, 213] ),
),
New Column( "Y2_absolute",
Numeric,
Set Values( [12, 6, 4, 0, 80, 90, 120, 75, 8.3, 9.7, 6.4, 5.2] ),
),
New Column( "Y2_relative",
Numeric,
Set Values( [., 50, 33, 0, 100, 113, 150, 94, 100, 66, 37, 12] ),
)
);
// finding and selecting Y columns where for any :time == 0 a value of 100 is found in the same row
dt << Select Where( dt:time == 0 );
dtTemp = dt << Subset ( Selected Rows, Selected Columns Only( 0 ) );
For( i = 1, i <= N Row( dtTemp ), i++,
For( j = 1, j <= N Col( dtTemp ), j++,
If( Column( dtTemp, j )[i] == 100,
Column( dt, j ) << Set Selected( 1 ),
)
)
);
Close( dtTemp, no save );
dt << Clear Select( );