Controlla i dati in file di una tabella per vedere se sono in colonne di un'altra tabellaPrimo tavolo:

Seconda tabella:

Sto cercando di verificare i valori massimi nella quarta riga della prima tabella rispetto alle colonne adiacenti della seconda tabella.
Finora, ho estratto i nomi delle colonne e i valori delle righe dalla prima tabella:
dt1 = Open();
namesForCols = dt1 << get column names("String");
show(namesForCols);
row4 = dt1[4, 0];
show(row4);
close(dt1,nosave);Come posso verificare se i valori nella lista row4 esistono nelle colonne della seconda tabella? Grazie.
Ri: Controllare i dati in righe di una tabella per vedere se sono in colonne di un'altra tabellaEcco un semplice script che risponde alla tua domanda.
Names Default To Here( 1 );
dt1 = Data Table( "Table 1" );
dt2 = Data Table( "Table 2" );
// Get the numeric columns
colNamesList = dt1 << get column names( numeric, string );
// Add a new row of data, that will tell how many rows in
// Table 2 have the maximumn values from row 4
dt1 << add rows( 1 );
dt1:Column 1[N Rows( dt1 )] = "Number of Rows Found";
// Loop across the numeric columns in table 1
For( i = 1, i <= N Items( colNamesList ), i++,
// If the column in table 2 exists, process
If( Try( Column( dt2, colNamesList[i] ) << get name, "" ) != "",
// Get the value from table 1 to compare with in table 2
compareValue = Column( dt1, colNamesList[i] )[4];
// Find the number of rows in table 2 that match the
// value in row 4 of table 1 and save it into row 5
// of table 1
Column( dt1, ColNamesList[i] )[N Rows( dt1 )] =
N Rows(
dt2 << get rows where(
As Column( dt2, colNamesList[i] ) == compareValue
)
);
)
);