从数据表在变异性图表中添加规格限你好呀,
我的 JMP 版本是 10.0.2。 由于工作需要,我有数百个参数需要分析,每个参数都有100多个数据点。 我的客户向我发送了另一个文件,其中包括 Excel 中这些参数的 LSL、目标和 USL。 因此,我想知道当我绘制 Variabiltiy 图表时是否有一个脚本/嵌入式工具将规格限制与相应的参数链接起来(X 轴应是不同的批次号,Y 轴是参数数据)。 我还想显示原始数据的箱线图。 目前我所有这些都是手动完成的,这浪费了很多时间。 所以请让我知道是否有解决方案(我认为应该有)
请原谅,由于保密原因,我无法显示原始数据文件。 先感谢您。
回复:从数据表在变异性图表中添加规格限值谢谢尼尔森,这个脚本可以适用于我的案例。 非常感谢您的耐心和支持!
回复:从数据表在变异性图表中添加规格限值您的列名称包含 JMP 将尝试执行的字符,而不是将它们用作名称的一部分。因此,我必须添加 :Name() 函数来强制 JMP 将完整值解释为名称。请参阅下面的脚本。
注意:dt = 和 dtLimits = 语句已更改为查找已打开的数据表。您可能需要将它们更改回使用 open() 函数。
// Open table to have limits set on
dt = data table("raw data");
dtLimits = data table("Spec limit");
// Get a list of all of the numeric columns in the measurment data table
colNames = dt << get column names( numeric, string );
// Loop across the Limits table and apply the findings to data table
For( i = 1, i <= N Rows( dtLimits ), i++,
// If a column in the measurement data table has the same name as the current
// Limits data table column "Parameter" has, then process the data
colNamesPosition = Loc( colNames, dtLimits:Parameter[i] );
If( N Rows(colNamesPosition) > 0,
Eval(
Substitute(
Expr(
__col__ << set property(
"Spec Limits",
{LSL( __LSL__ ), USL( __USL__ ), Target( __Target__ ), Show Limits( 1 )}
)
),
Expr( __col__ ), Parse( "dt:Name(\!"" || colNames[colNamesPosition[1]] || "\!")" ),
Expr( __LSL__ ), dtLimits:LSL[i],
Expr( __USL__ ), dtLimits:USL[i],
Expr( __Target__ ), dtLimits:Target[i]
)
)
);
);
// Run Variability Charts
Variability Chart( Y( :Name("TWNB_10/10$Vtlin%V"), :Name("TWNB_10/10$Idlin%uA/um") ), X( :wafer ) );回复:从数据表在变异性图表中添加规格限制我附上了简化的原始数据表和规格极限表。 我认为错误来自于我的参数的命名规则,其中包含 $. 但我无法更改参数名称。 请帮忙检查一下。 万分感激。
回复:从数据表在变异性图表中添加规格限值我提供的脚本假设 Limits 数据表列已命名
这些是您的 Limits 数据表中的列名称吗?
您能否附上您的极限数据表和测量数据表的副本。这将有助于问题的调试。
回复:从数据表在变异性图表中添加规格限值谢谢尼尔森。 我修改了脚本,这次弹出另一个错误,提示“范围数据表访问需要数据表列或变量”。 这让我再次困惑。 你能告诉我原因吗?
回复:从数据表在变异性图表中添加规格限制我刚刚发现我的代码中有一个错误。请更改代码中的行
If( N Rows( ) > 0,
到
If( N Rows( colNamesPosition ) > 0,
回复:从数据表在变异性图表中添加规格限值原始数据.jmp 中的参数只是规格限制.jmp 中所有参数的一部分。 那么这可能是原因吗?
我对 JSL 很陌生,所以,如果可能的话,请让我知道其他函数是否可以根据我的情况做类似的事情。 非常感谢你的帮助。
回复:从数据表在变异性图表中添加规格限值问题是 Loc() 函数在 colNames{} 列表中找不到匹配项。 该函数需要精确匹配。 大写/小写、间距等都可能导致问题。回复:从数据表在变异性图表中添加规格限值嗨内斯隆,
我想我知道问题所在,或者至少知道我的想法和你的脚本之间的差异。 请原谅我之前没有描述清楚。
一开始,我创建了一个新的数据表,其中粘贴了原始数据。 我假设这是当前的数据表。 所以我将其定义为dt=当前数据表()。 然后我打开保存的 Spec Limits.jmp 文件
dtLimits<SPAN class="token operator">=</SPAN><SPAN class="token function">Open</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"$Desktop\JMP\Spec limits.jmp"</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
我认为根据我发布的脚本这不能工作?
我现在要做的是将新数据表保存为raw data.jmp。 然后使用下面的脚本。 但参数中仍然没有添加规格限制。
// Open table to have limits set on
dt = Open( "C:\Users\Desktop\JMP/raw data.jmp" );
// Open spec limit table
dtLimits = Open( "C:\Users\Desktop\JMP/Spec limits.jmp" );
// Get a list of all of the numeric columns in the measurement data table
colNames = dt << get column names( numeric, string );
// Loop across the Limits table and apply the findings to data table
For( i = 1, i <= N Rows( dtLimits ), i++,
// If a column in the measurement data table has the same name as the current
// Limits data table column "Parameter" has, then process the data
colNamesPosition = Loc( colNames, dtLimits:Parameter[i] );
If( N Rows() > 0,
Eval(
Substitute(
Expr(
__col__ << set property(
"Spec Limits",
{LSL( __LSL__ ), USL( __USL__ ), Target( __Target__ ), Show Limits( 1 )}
)
),
Expr( __col__ ), Parse( "dt:" || colNames[colNamesPosition[1]] ),
Expr( __LSL__ ), dtLimits:LSL[i],
Expr( __USL__ ), dtLimits:USL[i],
Expr( __Target__ ), dtLimits:Target[i]
)
)
);
);所以我尝试调试这个脚本;事实证明L22显示错误:无效下标(必须是数字或数字列表)。 我不确定为什么这在你的脚本中有效,但在我的脚本中不起作用。 如果您有任何想法请告诉我。 谢谢。
Expr( __col__ ), Parse( "dt:" || colNames[colNamesPosition[1]] ),
回复:从数据表在变异性图表中添加规格限制该声明:
dt=current data table();
将变量“dt”设置为指向已打开的数据表。因此,如果您的测量数据表或极限表都没有打开,您将需要使用
dt=open("<PATH>/data table name");</PATH>
打开您的测量数据表,而不是“当前数据表()”函数。
您需要确保您理解我在第一个响应中提供的 JSL,而不是仅仅将其剪切并粘贴到您的代码中。我的示例中使用的所有函数以及示例都记录在脚本索引中。
帮助==>脚本索引
回复:从数据表在变异性图表中添加规格限值嗨,纳尔逊,
非常感谢您的回复。 在您的示例中,您创建了两个数据表,一个是 Big Class.jmp,另一个是规格限制表。 但是就我而言,我已经存在这两个数据表。 所以我认为剩下的就是将两个表链接在一起,并执行您在脚本中提供的操作,从 colNames = dt << get 列名称 (numeric, string ) 开始。 我尝试如下:
dt=current data table();
show (dt);
dtLimits=Open( "$Desktop\JMP\Spec limits.jmp" );
然后附上
colNames = dt << get column names (numeric, string ).
以及之后。不幸的是,仅打开了 Spec Limits.jmp,但 Spec Limits 未添加到当前数据表中。 你能帮我调试一下吗? 万分感激。
回复:从数据表在变异性图表中添加规格限值以下是一个示例脚本,它将从限制数据表中读取值,并将它们应用到测量数据表中。当变异图表或大多数其他平台图表将显示规格限制时。
// Open table to have limits set on
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Create a limits table for the example
dtLimits = New Table( "Limits",
Add Rows( 2 ),
New Column( "Parameter", Character, "Nominal", Set Values( {"height", "weight"} ) ),
New Column( "LSL", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [52, 60] ) ),
New Column( "Target", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [63, 105] ) ),
New Column( "USL", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [70, 180] ) )
);
// Get a list of all of the numeric columns in the measurment data table
colNames = dt << get column names( numeric, string );
// Loop across the Limits table and apply the findings to data table
For( i = 1, i <= N Rows( dtLimits ), i++,
// If a column in the measurement data table has the same name as the current
// Limits data table column "Parameter" has, then process the data
colNamesPosition = Loc( colNames, dtLimits:Parameter[i] );
If( N Rows() > 0,
Eval(
Substitute(
Expr(
__col__ << set property(
"Spec Limits",
{LSL( __LSL__ ), USL( __USL__ ), Target( __Target__ ), Show Limits( 1 )}
)
),
Expr( __col__ ), Parse( "dt:" || colNames[colNamesPosition[1]] ),
Expr( __LSL__ ), dtLimits:LSL[i],
Expr( __USL__ ), dtLimits:USL[i],
Expr( __Target__ ), dtLimits:Target[i]
)
)
);
);
// Run Variability Charts
Variability Chart( Y( :height, :weight ), X( :sex ) );