我是 JSL 新手...
我想选择行,然后使用 OR 语句根据两个条件隐藏和排除。我想选择何时“注释”为空或何时排除总和 < 2。我可以让这两个条件独立工作,但是当我将它们与 OR 语句组合时,不会选择任何行。我也尝试过当前选择(“扩展”),结果相同。我正在使用 JMP 15.2.0
dt =Current Data Table();
dt <<CLEAR row="" states=""></CLEAR>
感谢您对此的任何想法。
@Craige_Hales效果非常好!我需要温习我的逻辑技能以及学习 JSL。谢谢。
我认为重写逻辑以便不需要 InvertRowSelection 可能有助于明确意图。 我猜你的意思可能是这样的
dt =Current Data Table();
dt <<CLEAR row="" states="">= 2 // if there are too many excluded
);
//dt << invert row selection; // leave this out, it makes the logic hard to follow
dt << exclude;
dt << hide;</CLEAR>
您提供的数据表中没有不符合您“选择位置”条件的行。每行的排除值小于 2 或注释为空,或两者兼而有之。具有注释的每一行的排除总和为 1,小于 2。因此,根据您的代码,最终不会隐藏和排除任何行。
@tx尼尔森我仍然无法让脚本在我的数据集上运行。我已对其进行了删减,并将其与脚本一起附加到了这篇文章中。恐怕我在这里遗漏了一些明显的东西。谢谢。
我的测试用例使用您的代码效果很好。

Names Default To Here( 1 );
dt = New Table( "Example",
Add Rows( 10 ),
New Column( "Comment",
Character,
"Nominal",
Set Values(
{"not blank", "not blank", "", "not blank", "", "not blank", "not blank",
"", "not blank", "not blank"}
),
Set Display Width( 89 )
),
New Column( "Excluded Sum",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [5, 1, 51, 44, 6, 0, 7, 1.5, 9, -5] )
)
);
dt << Clear Row States();
dt << select where( :comment == "" | :Excluded Sum < 2 );
dt << invert row selection;
dt << exclude;
dt << hide;