您好,我在 Mac 上使用 JMP 15。 以下代码有效:
dt = current data table();
Current Data Table() << Row Selection(
Select where( (:Stat == "Max"), Current Selection( Extend ))
);
但这并没有:
dt = current data table();
Current Data Table() << Row Selection(
var = "Max"
Select where( (:Stat == var), Current Selection( Extend ))
);
有人可以解释第二个有什么问题吗?
似乎发生了一些奇怪的事情(在 Windows 10 上使用 JMP16.0 进行了测试)。 使用行选择时请仔细查看括号
脚本索引的示例(工作正常):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Row Selection(Select where(:age < 15));
Wait(2);
dt << Row Selection(
Select where(:age == 15),
current selection("extend")
);在第二行选择之前添加变量并使用它(返回 Scriptable[]):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Row Selection(Select where(:age < 15));
Wait(2);
ageVar = 15;
dt << Row Selection(
Select where(:age == ageVar),
current selection("extend")
);
将括号从 SelectWhere 的末尾移动到当前选择之后(似乎工作正常,但对于基于脚本索引的行选择,此语法似乎是错误的):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Row Selection(Select where(:age < 15));
Wait(2);
ageVar = 15;
dt << Row Selection(
Select where(:age == ageVar,
current selection("extend"))
);
使用“选择平台”时,生成的脚本似乎是:
Data Table("Big Class") << Row Selection(
Select where(:age == 15, Current Selection("Extend")),
Dialog(Edit(Equal(Source Column(:age))), Keep dialog open(1))
);
不使用行选择时的选择:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt << Row Selection(Select where(:age < 15));
Wait(2);
ageVar = 15;
dt << Select where(:age == ageVar, current selection("extend"));
如果不需要对话框,我很可能总是使用 << SelectWhere (没有行选择),因为语法更简单,并且我不确定除了对话框之外,行选择是否会给表带来任何额外的内容。
不确定在此处标记 JMP/SAS 的谁来查看此问题。
尝试将 var = "Max" 移到 << Row Selection() 之外。 并添加缺失的;