大家好,
我想在調用 Pareto 函數時編寫“By”腳本。我注意到“由”繪製的帕累托圖如下所示:
Pareto Plot(Cause( :SBIN_NAM ), X( :Insertion ), Where( :lot_id == "4LU31HFN00_E95029" ))
“Where”實現了 Pareto 函數對話框中的“By”字段。
所以,我有一個 JMP 腳本,我想在其中通過名為“lot_id”的列繪製帕累托圖。但是,我希望腳本是通用的,所以我不知道“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 cumulative 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 cumulative Percent Curve( 0 ), Where(:lot_id == \!"" || listOfLotIDs[i] || "\!"))";
eval(Parse(sEval));
print("PRINT OUTPUT: " || sEval);
);
我相信“解析”函數會編譯一個 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 cumulative 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 cumulative 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 cumulative 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 cumulative 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 cumulative Percent Curve( 0 ), Where(:lot_id == \!"4LU31HFR00_E94699\!"))"
那麼到底是哪裡出了問題呢?我的轉義引號 (\!") 是如何變成破折號“-”的?!請幫忙。
順便說一句,論壇聲稱它從我的消息正文中刪除了“無效的 HTML”,請注意,某些代碼或錯誤消息可能會出現亂碼。