我是 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;