It is difficult to tell why it not works in a particular case without a table for testing the code. If code depends on column formulas created in the same script, I have experienced that formula evaluation can lag behind the script execution which can lead to unexpected results. To avoid this one can try to insert Wait() or << eval formula at the critical steps.
However in this particular case, if I understand it correctly, there is no need for a new column (or a data filter). Perhaps the below example can be of help.
//example table
dt = New Table( "test",
Add Rows( 5 ),
New Column( "Instr", Character,
Set Values( {"drum", "trumpet", "lyre", "clarinet", "didgeridoo"} )
)
);
// Select instr starting with d or l using a data filter
sel = dt << get rows where( Starts With( :instr, "d" ) | Starts With( :instr, "l" ) );
dt << data filter(
add filter( columns( :instr ), where( :instr = :instr[sel] ), mode( select( 1 ) ) )
);
dt << subset( output table name( "sel instr" ), Selected Rows( 1 ), selected columns( 0 ) );
// Or a more direct approach without data filter
dt << select where( Starts With( :instr, "d" ) | Starts With( :instr, "l" ) );
dt << subset( output table name( "sel instr" ), Selected Rows( 1 ), selected columns( 0 ) );