大家好,
我想在调用 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\!"))"
那么世界上有什么问题呢?我的转义引号 (\!") 是如何变成破折号“-”的?!请帮忙。