问题
假设您的数据表选择了一组行。现在,您要从该选择中选择满足附加条件的行。
解决方案
这选择哪里()数据表对象的消息提供一个选项,允许您指定从当前选择中进行选择。以下示例演示如何使用 Current Selection() 选项将新选择限制为仅当前选定的行。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
/* Establish the original row selection of students under 14 years old */
dt << Select Where( :age < 14 );
Wait( 1 ); //For demonstration purposes
/* Of the students less than 14, select students who are also above 5ft in height */
dt << Select Where(
:height > 60,
Current Selection( "restrict" )
);
讨论
Select Where() 的 Current Selection() 选项具有三个选项:严格,延长, 和清除.上面的例子演示了使用严格.这延长参数允许您在不影响原始选定行的情况下选择其他行。这清除参数在进行新选择之前取消选择所有行。此行为与未在 Select Where() 中指定 Current Selection() 选项相同。
更多使用 Select Where() 的示例可以在选择行JMP 脚本指南的部分。也可以看看
根据多个条件选择行
选择与列表中的任何值匹配的行