Ho bisogno di uno script che esamini tutte le colonne e le celle colorate con il valore "< LOD". Il mio script non fornisce il risultato desiderato. Qualche consiglio?
dt = Current Data Table();
// Get all of the column names in the data table
ColNames = dt << get column names( string );
NRows = N Rows( dt );
// Loop through each column and row to find "< LOD" and color the previous cell
For( i = 1, i <= N Items( ColNames ), i++,
column = Column( dt, ColNames[i] );
For( j = 2, j <= NRows, j++, // Start at row 2 to avoid coloring out-of-bound cells
If( Row(j) == "< LOD",
column << Color Cells( j - 1, "Red" );
)
);
);
Altre soluzioni più eleganti sono più che benvenute!
Questo cerca il valore "F", ma molto probabilmente fornisce qualche idea su cosa potresti modificare (ottenere in anticipo tutte le righe per ogni colonna, ordinare gli argomenti delle celle colorate, ...)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
colnames = dt << get column names(character, string);
For Each({colname}, colnames,
r = Loc(dt[0, colname], "F");
If(N Items(r) > 0,
Column(dt, colname) << Color Cells("Red", r);
);
);
Write();
Modifica: rimosso Show(r); non necessario dal ciclo