Re : 일치하는 열이있는 2 개의 다른 데이터 테이블이있는 행을 선택하는 방법이 작업을 수행하는 3 가지 방법이 있습니다.
names default to here(1);
dt = Open( "$SAMPLE_DATA/BIG CLASS.JMP" );
dt1 = dt << Subset( Columns( Name ), Output Table Name( "1" ) );
dt1 << Delete Rows( 15 :: 40 );
// Method one, read a name in dt1 and select it in dt, repeat
// for all rows in dt1
dt << clear rowstates;
For(i=1,i<= nrows(dt1),i++,
dt << select where(dt:name == dt1:name[i], current selection("extend"));
);
// Method 2, extract names from dt1 into a list, and then
// compare against the list for the
dt << clear rowstates;
nameList = dt1:name << get values;
dt << select where(contains(nameList,:name));
//Method 3, Update dt with dt1 and select matching rows
// this method would be the fastest on large data tables
dt << clear rowstates;
// add a column to use as a selector
dt1 << New Column( "selector", set each value( 1 ) );
dt << Update( With( dt1 ), Match Columns( :name = :name ) );
dt << select where( :selector == 1 );
dt << delete columns( "selector" );
dt1 << delete columns( "selector" );Re : 일치하는 열이있는 2 개의 다른 데이터 테이블이있는 행을 선택하는 방법정말 고맙습니다일치하는 열이있는 2 개의 다른 데이터 테이블이있는 행을 선택하는 방법아래의 & * 스크립트가 작동하지 않습니다. 디버깅하고 실행 가능한 스크립트를 보내도록 도와주세요. dt1의 열 : name과 일치하는 dt의 "모든 행을 선택"하는 기능을 알고 싶습니다.
dt = Open( "$SAMPLE_DATA/BIG CLASS.JMP" );
dt1 = dt << Subset( Columns( Name ), Output Table Name( "1" ) );
dt1 << Delete Rows( 15 :: 40 ); // I want to relize the function of "select all rows that (dt:name==dt1:name) dt << Select where( With(dt1), By Matching Columns(name==name), );
;
스크립팅Re : 일치하는 열이있는 2 개의 다른 데이터 테이블이있는 행을 선택하는 방법정말 맛있어요! 방법 1을 사용했습니다.
이것이 작동하려면 데이터 테이블의 파일 경로를 복사하여 붙여 넣어야했습니다. 전체 경로없이 파일 이름을 입력 할 수 있도록 작업 디렉토리를 변경하는 방법을 알 수 없었습니다.