How to find tool that processed max number of cells in batch and place that tool ID in a new column.I have batches of cells that mostly get processed on one alignment tool. Occasionally a batch will be processed over a few alignment tools.
I want to find the tool that processed the maximum number of cells in a batch and then add a column (MAX AL)at the end with that alignment tool ID.
Thanks
Automation and ScriptingRe: How to find tool that processed max number of cells in batch and place that tool ID in a new column.adding table.
Re: How to find tool that processed max number of cells in batch and place that tool ID in a new column.One option
Names Default To Here(1);
dt = Open("$DOWNLOADS/ALIGNMENT TOOL.jmp");
// Get AL cols
al_cols = Filter Each({col_name}, dt << Get Column Names("String"),
!IsMissing(Regex(col_name, "^AL\d+"));
);
// create new collector column
new_col = dt << New Column("MAX AL", Character, Nominal);
For Each Row(dt,
max_al_idx = Loc Max(dt[Row(), al_cols]); // get idx based on max value
al_name = al_cols[max_al_idx]; // find AL name with the idx
new_col[Row()] = al_name; // set value
)