無法在表格公式上使用 jmp 腳本執行布爾邏輯你好,
我正在嘗試運行一個簡單的腳本,該腳本將選擇然後隱藏和排除距中心徑向距離大於 100 毫米的點。
為了簡化調試,我將其拆分為兩個腳本:第一個生成具有徑向距離 Radial = (x^2 + y^2)^(1/2) 公式的列,第二個計算此公式,選擇和隱藏行其中徑向 > 100。
不幸的是,這不起作用。 出於一些非常奇怪的原因,評估只適用於這個公式直到某個值。 Radial >(大於 30)選擇所有行。
我可以看到兩種解決方案:
1) 將值寫入徑向列,而不是公式本身。 (正確評估值,而不是公式)。 不知道如何做到這一點。
2) 理解並糾正問題,以便可以針對大於 30 的值評估公式。
腳本答案或交互式解釋都是可以接受的。 想解決這個問題並從中學習。
謝謝!
戴夫
// script for creating the Radial column<BR />dt1 = Current Data Table ();
dt1 << New Column( "Radial", Formula ((X coordinate^2 + Y coordinate^2)^(1/2)));<BR /><BR />// script for evaluating the Radial formula<BR />dt =Current Data Table();<BR />dt << Clear Row States; <BR />dt << Select where(Radial < 100);<BR />dt << hide and exclude;<BR />
腳本編寫回复:無法在表格公式上使用 jmp 腳本執行布爾邏輯用於創建徑向列的腳本
dt1 = Current Data Table ();
dt1 << Clear Row States;
dt1 << New Column( "Radial", Formula ((X coordinate^2 + Y coordinate^2)^(1/2)));
用於評估徑向公式的腳本
dt =Current Data Table();
dt << Clear Row States;
dt << Select where(Radial < 100);
dt << hide and exclude;
回复:無法在表格公式上使用 jmp 腳本執行布爾邏輯恐怕我無法在這裡重現任何問題。 這是我用來測試的腳本。
dt1 = New Table( "Community 416651 Select Where",
Add Rows( 1000000 ),
New Column( "x coordinate",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Sequence( 5, 100, 5 ) ),
Set Selected
),
New Column( "y coordinate",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( Sequence( 5, 100, 5, 20 ) ),
)
);
dt1 << New Column( "Radial",
Formula(
(X coordinate ^ 2 + Y coordinate ^ 2) ^ (1 / 2)
)
);
dt1 << Select where( Radial < 60 );
因此,我們將需要更多有關您的腳本和數據表的詳細信息。
你的數據表有多大? 你的腳本還在做什麼?
回复:無法在表格公式上使用 jmp 腳本執行布爾邏輯感謝您回复傑夫。
將腳本的最後一行粘貼到我的並沒有解決問題。 但是,我能夠通過將列的名稱更改為“Radial 1”並在末尾添加一行 Eval Formula 來提供解決方案。 不知道為什麼會這樣。 數據表大約有 1300 行 15 列,每個數字的寬度為 10 到 12。
以下兩個腳本有效。 我將它們全部粘貼。 其他線評估凹坑深度和分佈。
知道為什麼修改有效嗎? 我大部分時間都在這。
腳本 1:創建“僅坑”和“徑向 1”列
dt1 = Current Data Table ();
dt1 << Clear Row States;
dt1 << New Column( "Pits Only", Formula (If( :Name( "Height (mm)" ) <= 0, :Name( "Height (mm)"), 0 )) );
dt1 << New Column( "Radial 1", Formula ((X coordinate^2 + Y coordinate^2)^(1/2)));
dt1 << Eval Formula;
obj = dt1 << Distribution( Column( :Pits Only), Horizontal Layout( 1 ), Count Axis);
腳本 2:隱藏和排除僅坑 > 10 或徑向 1 > 100 或徑向 1 < 30 的行
dt =Current Data Table();
dt << Clear Row States;
win = New Window( "Feature Depth" , <<MODAL> 100) | (Radial 1< 30) | (Pits Only > mf));
dt << hide and exclude;</MODAL>