CIAO,
Sto cercando di scorrere ciascun valore di X e Y e di salvare il valore rn massimo nella colonna MaxValue.
Ecco cosa ho provato ma qualcosa non sembra corretto. Qualche consiglio?
Names Default To Here( 1 );
// Assuming your data table is named 'dt'
dt = Current Data Table();
// Create a new column "MaxValue" and initialize with a large negative number
// Loop through unique Barcode values
// Loop through rows
dt << begin data table();
// Loop through rows
For( i = 1, i <= N Rows( dt ), i++,
currentBarcode = dt:Barcode[i];
// Find the location of the maximum rn value for the current Barcode
maxRNRow = Max( dt:rn[dt:Barcode[i] == currentBarcode] );
// Check if the maxRNRow is not 0 (meaning there is at least one matching Barcode)
If( maxRNRow != 0,
// Update "MaxValue" column with the max rn value for the current Barcode
dt:MaxValue[i] = dt:rn[maxRNRow]
);
);
dt << end data table();