Hi @hcarr01,
I'm not sure I understand your request correctly, but how about the following script?
Names Default To Here( 1 );
dt = Current Data Table();
dur_cols = Filter Each( {col_name}, dt << Get Column Names( "String", Continuous ),
Starts With( col_name, "durée" )
);
// for indexing later
num_colnr = Transform Each( {col_name}, dur_cols, Word( -1, col_name ) );
// Add : Matrix of the index
num_colnr_mt = Matrix( Transform Each( {col_name}, dur_cols, Num( Word( -1, col_name ) ) ) )`;
dt << New Column( "DUREE ETAPE1",
Numeric,
Continuous,
Format( ":jou:hh:m", 8 ),
<<Set Each Value(
If( :"T"n < 2100,
//colidx = Loc(dt[Row(), num_colnr] > :"opé"n & (num_colnr < 2100 ) );
colidx = Loc( dt[Row(), num_colnr] >= :"opé"n & (num_colnr_mt < 2100) ); // Changed
If( N Items( colidx ) > 0,
val = Sum( dt[Row(), dur_cols[colidx]] );
If( Is Missing( val ),
0,
val
);
,
0
);
,
0
)
)
);
If you want to calculate the following code, you need to use matrix.
"num_colnr < 2100"
I hope it helps.