Ciao,
Buon Anno!
C'è un modo per rendere l'elaborazione più veloce?Ho provato a usarlo per ciascuno , e ha fatto risparmiare un po' di tempo. Sto cercando di capire se posso ottimizzare utilizzando il file Formula di colonna
Ecco il mio ciclo for. Ci vuole molto tempo per eseguire oltre 1 milione di iterazioni. Qualche consiglio?
Names Default To Here( 1 );
dt = Current Data Table();
start = Tick Seconds();
dt << Clear Row States;
dt << Clear Column Selection();
//Does Table Variable Exist?
var = dt << Get Table Variable( "YieldIteration" );
varnum = Num( var );
If( var == "",
dt << Set Table Variable( "YieldIteration", 1 ),
dt << Set Table Variable( "YieldIteration", varnum + 1 )
);
var = dt << Get Table Variable( "YieldIteration" );
varnum = Num( var );
dt << Clear Column Selection;
allcol = dt << get column names( string );
dt << select column group( "Tests" );
selcol = dt << get selected columns;
nselcol = N Items( selcol );
FUDDnum = Round( nselcol * 0.17 );
dt << Clear Column Selection();
// function to get spec limits
Spec = Function( {colno},
colspec = Column( colno ) << get property( "Spec Limits" );
lsl = colspec["LSL"];
usl = colspec["USL"];
L = Matrix( {lsl, usl} );
);
// set up pareto columns
PassCol = New Column( "PassFail" || var, Numeric, <<SET each="" value=""> L[2],
PassCol[jj] = 0;
If(
ParetoCol[jj] != ".", ParetoCol[jj] = ParetoCol[jj] || ", " || selcolchar,
ParetoCol[jj] == ".", ParetoCol[jj] = selcolchar
);
NumFail[jj] = NumFail[jj] + 1;
);
If( NumFail[jj] >= FUDDnum,
ParetoCol[jj] = "FUDD"
);
);
);
);
dt << end data update;
end2 = Tick Seconds();
runtimetoshow = end2 - start;
formated = Format( runtimetoshow, "min:s", 12 );
Caption( "Runtime: " || formated || "min" );</SET>Grazie.