從數據表在變異性圖表中添加規格限你好呀,
我的 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 ) );