大家好,
我想在調用 Pareto 函數時編寫“By”腳本。我注意到帕累托圖繪製“按”看起來像這樣:
Pareto Plot(Cause( :SBIN_NAM ), X( :Insertion ), Where( :lot_id == "4LU31HFN00_E95029" ))
“Where”實現 Pareto 函數對話框中的“By”字段。
所以,我有一個 JMP 腳本,我想在其中通過名為“lot_id”的列繪製 Pareto 圖。但是,我希望腳本是通用的,所以我不知道“lot_id”是什麼。因此,傳遞到“Where”的值是在運行時由數據表中實際存在的 lot_id 決定的。
起初,我在數據表中創建了一個名為“listOfLotIDs”的所有 lot_id 的列表,並嘗試了常識性方法。這沒有用:
For( i = 1, i <= N Items( listOfLotIDs ), i++,
Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show Cum Percent Curve( 0 ), Where(:lot_id == listOfLotIDs[i] ));
);
一段時間後,我開始相信我的代碼不起作用,因為出於某種原因,傳遞給“Where”函數的值必須在括號內定義實際引號- 你不能只給它傳遞一個字符串變量。所以,我嘗試了另一種變體:
For( i = 1, i <= N Items( listOfLotIDs ), i++,
sEval = "Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show Cum Percent Curve( 0 ), Where(:lot_id == \!"" || listOfLotIDs[i] || "\!"))";
eval(Parse(sEval));
print("PRINT OUTPUT: " || sEval);
);
我相信“parse”函數會編譯一個 JMP 腳本,而“eval”函數會運行一段已編譯的 JMP 腳本? 但是,這也不起作用。我包含了字符串的 print() 只是為了確保我正確地組裝了字符串。這就是日誌所說的:
Error for Pareto Plot on data table 'Subset of 4LU31HFN00_E95029,4LU31HFO00_E93847,4LU31HFP00_E93 20 Where(lot_id == -4LU31HFN00_E95029-)' : One or more columns have missing values on all rows.
"PRINT OUTPUT: Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show Cum Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFN00_E95029\!"))"
Error for Pareto Plot on data table 'Subset of 4LU31HFN00_E95029,4LU31HFO00_E93847,4LU31HFP00_E93 20 Where(lot_id == -4LU31HFO00_E93847-)' : One or more columns have missing values on all rows.
"PRINT OUTPUT: Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show Cum Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFO00_E93847\!"))"
Error for Pareto Plot on data table 'Subset of 4LU31HFN00_E95029,4LU31HFO00_E93847,4LU31HFP00_E93 20 Where(lot_id == -4LU31HFP00_E93981-)' : One or more columns have missing values on all rows.
"PRINT OUTPUT: Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show Cum Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFP00_E93981\!"))"
Error for Pareto Plot on data table 'Subset of 4LU31HFN00_E95029,4LU31HFO00_E93847,4LU31HFP00_E93 20 Where(lot_id == -4LU31HFQ00_E95030-)' : One or more columns have missing values on all rows.
"PRINT OUTPUT: Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show Cum Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFQ00_E95030\!"))"
Error for Pareto Plot on data table 'Subset of 4LU31HFN00_E95029,4LU31HFO00_E93847,4LU31HFP00_E93 20 Where(lot_id == -4LU31HFR00_E94699-)' : One or more columns have missing values on all rows.
"PRINT OUTPUT: Pareto Plot( Cause( :SBIN_NAM ), X( :Insertion ), Per Unit Rates( 1 ), Show Cum Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFR00_E94699\!"))"
那麼世界上有什麼問題呢?我的轉義引號 (\!") 是如何變成破折號“-”的?!請幫忙。