한 테이블의 행에있는 데이터를 검사하여 다른 테이블의 열에 있는지 확인합니다.첫 번째 표 :

두 번째 테이블 :

두 번째 테이블에서 인접한 열에 대해 첫 번째 테이블의 네 번째 행의 최대 값을 확인하려고합니다.
지금까지 첫 번째 테이블에서 열 이름과 행 값을 추출했습니다.
dt1 = Open();
namesForCols = dt1 << get column names("String");
show(namesForCols);
row4 = dt1[4, 0];
show(row4);
close(dt1,nosave);목록 row4의 값이 두 번째 테이블의 열에 존재하는지 어떻게 확인할 수 있습니까? 감사.
Re : 한 테이블의 행에있는 데이터를 검사하여 다른 테이블의 열에 있는지 확인합니다.다음은 질문에 대한 간단한 스크립트입니다.
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
)
);
)
);