回复:如何选择具有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" );回复:如何选择具有2个不同数据表和匹配列的行非常感谢如何选择具有2个不同数据表和匹配列的行下面的&* script不起作用,您能帮我调试并向我发送可行的脚本吗?我想实现在dt中“选择所有行”与列匹配的功能:dt1中的name。
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), );
;
脚本编写回复:如何选择具有2个不同数据表和匹配列的行这真是太好了!我使用方法1。
我需要复制粘贴数据表的文件路径才能正常工作。我不知道如何更改工作目录,以便我可以只输入文件名而不需要整个路径。