最終收益率表問題txnelson 先生非常友好地與我分享了一個很棒的腳本,該腳本將通過/失敗分配給列,然後最終根據整行分配最終的通過/失敗。 我想將最後一列分成子列,雖然我知道如何在概念上完成它,但我無法弄清楚正確的語法..
這段代碼找到所有列中的最小值,但是我想添加子集
Eval( Parse( "dt2 << New Column( \!"Row Pass/Fail\!", 公式( If( Min(" || foundCols || " ) == 1, 1, 0 ) )" ) );
列:
行通過/失敗
Test_1 通過/失敗
Test_2 通過/失敗
Test_3a 通過/失敗
Test_3b 通過/失敗
Test_3c 通過/失敗
Test_3d 通過/失敗
Test_3e 通過/失敗
Test_4_State_1 通過/失敗
Test_4_State_3 通過/失敗
Test_4_State_4 通過/失敗
colList = dt2 << Get Column Names( numeric, string );
foundCols = "";
For( i = 1, i <= N Items( colList ), i++,
Spec = Column( dt2, colList[i] ) << Get Property( "Spec Limits" );
dt2 << Clear Select;
If( Is Empty( Spec ) == 0,
dt2 << New Column( (Column( dt2, colList[i] ) << Get Name) || " Pass/Fail" );
If( Is Missing( Try( Spec["LSL"], . ) ) == 0,
dt2 << Select Where( As Column( dt2, colList[i] ) < Spec["LSL"] );
Try( Column( dt2, N Cols( dt2 ) )[dt2 << get selected rows] = 0 );
);
If( Is Missing( Try( Spec["USL"], . ) ) == 0,
dt2 << Select Where( As Column( dt2, colList[i] ) > Spec["USL"], Current Selection( "Extend" ) );
Try( Column( dt2, N Cols( dt2 ) )[dt2 << Get Selected Rows] = 0 );
);
dt2 << invert row selection;
Try( Column( dt2, N Cols( dt2 ) )[dt2 << Get Selected Rows] = 1 );
Column( dt2, N Cols( dt2 ) ) << Set Property( "Value Labels", {1 = "Pass", 0 = "Fail"} );
If( foundCols == "",
foundCols = ":Name(\!"" || (Column( dt2, colList[i] ) << Get Name) || " Pass/Fail\!")",
foundCols = foundCols || ", " || ":Name(\!"" || (Column( dt2, colList[i] ) << Get Name) || " Pass/Fail\!")"
);
);
);
回复:最終收益率表問題我不得不有點創意,但它做到了......它看起來有點笨拙,但它完成了工作.. 謝謝
ycols_3 = dt3 << Get Column Names( Numeric, Continuous );
yPassFail = {};
For( i = 1 , i <= N Items( ycols_3 ), i++,
If( Contains( ycols_3[i], "Pass/Fail" ),
Insert Into( yPassFail, ycols_3[i]);
)
);
Show( yPassFail );
txList = {};
For( i = 1 , i <= N Items( yPassFail ), i++,
If( Contains( yPassFail[i], "TX S12 State 01" ),
Insert Into( txList , yPassFail[i]);
)
);
rxList = {};
For( i = 1 , i <= N Items( yPassFail ), i++,
If( Contains( yPassFail[i], "RX S21 State 03" ),
Insert Into( rxList , yPassFail[i]);
)
);
deltaAmpList = {};
For( i = 1 , i <= N Items( yPassFail ), i++,
If( Contains( yPassFail[i], "Delta Amp" ),
Insert Into( deltaAmpList , yPassFail[i]);
)
);
txList = Char( txList );
rxList = Char( rxList );
deltaAmpList = Char( deltaAmpList );
Eval( Parse( "dt3 << New Column( \!"Tx_Spar\!", Formula( If( Min(" || txList || " ) == 1, 1, 0 ) ) )" ) );
Eval( Parse( "dt3 << New Column( \!"Rx_Spar\!", Formula( If( Min(" || rxList || " ) == 1, 1, 0 ) ) )" ) );
Eval( Parse( "dt3 << New Column( \!"Rx_SparDelta\!", Formula( If( Min(" || deltaAmpList || " ) == 1, 1, 0 ) ) )" ) );
回复:最終收益率表問題我假設有問題的變量是“FoundCols”。您將其設置為“”的值,這使得變量“FoundCols”成為一個字符串,而不是一個列表。稍後在您的代碼中,您檢查變量“FoundCols”是否等於 {},事實並非如此。它等於“”。如果要將“FoundCols”初始化為空列表,請指定:
FoundCols = {};回复:最終收益率表問題不幸的是,錯誤消息“N Items() argument must be a list{579}”仍然是同樣的問題
我相信您在我開始沿著這條道路前行時提供了這段代碼。
哦,我們現在有 JMP 15,所以如果有另一種方法,我會洗耳恭聽(眼睛)......
謝謝
colsToPassFail = dt3 << get column names( numeric, String );
Show( colsToPassFail );
foundCols = "";
For( i = 1, i <= N Items( colsToPassFail ), i++,
Spec = Column( dt3, colsToPassFail[i] ) << Get Property( "Spec Limits" );
dt3 << Clear Select;
If( Is Empty( spec ) == 0,
dt3 << New Column( ( Column( dt3, colsToPassFail[i] ) << Get Name) || " Pass/Fail" );
If( Is Missing( Try( spec["LSL"], . ) ) == 0,
dt3 << Select Where( As Column( dt3, colsToPassFail[i] ) < spec["LSL"] );
Try( Column( dt3, N Cols( dt3 ) )[dt3 << Get Selected Rows] = 0 );
);
If( Is Missing( Try( spec["USL"], . ) ) == 0,
dt3 << Select Where( As Column( dt3, colsToPassFail[i] ) > spec["USL"], Current Selection( "extend" ) );
Try( Column( dt3, N Cols( dt3 ) )[dt3 << Get Selected Rows] = 0 );
);
dt3 << Invert Row Selection;
Try( Column( dt3, N Cols( dt3 ) )[dt3 << Get Selected Rows] = 1 );
Column( dt3, N Cols( dt3 ) ) << set property( "Value Labels", {1 = "Pass", 0 = "Fail"} );
If( foundCols == {},
foundCols = ":Name(\!"" || (Column( dt3, colsToPassFail[i] ) << Get Name) || " Pass/Fail\!")",
foundCols = foundCols || ", " || ":Name(\!"" || (Column( dt3, colsToPassFail[i] ) << Get Name) || " Pass/Fail\!")"
);
);
);
dt3 << Clear Select;
txList = {};
For( i = 1 ,i <= N Items( foundCols ), i++,
If( Contains( foundCols[i], "TX" ),
Insert Into( txList, foundCols[i]);
)
);回复:最終收益率表問題我意識到我在上一個條目中犯了一個錯誤。填充 NewList 的代碼需要更改為:
newList = {};
For( i=1,i<=N Items(foundCols),i++,
If(contains(foundCols[i],"Tx"),
insert into( newList, foundCols[i]);
)
);
試試這個,看看是否有幫助
回复:最終收益率表問題我很抱歉,自從我最初發布以來,我終於有時間重新審視它。 我收到“N Items() 參數必須是一個列表”的錯誤。
foundCols = "";是原始代碼,不在列表中。
這是我認為應該發生的
listCols = { foundCols };
listCols = Eval List ( listCols );
此時我將所有 foundCols 放入列表中但是當我運行下面的腳本時 newList 不會填充..
newList = {};
For( i = 1, i <= N Items( listCols ), i++,
If( Contains( listCols, "TX" ),
Insert Into( newList, listCols[i]);
)
);
提前致謝
回复:最終收益率表問題我認為您可以做的是簡單地創建一個僅包含具有 Rx 3 名稱的列的新列表,然後使用該列表創建一個新列以在新列中設置值。就像是:
newList = {};
For( i=1,i<=N Items(foundCols),i++,
If(contains(foundCols,"Rx 3"),
insert into( newList, foundCols[i]);
)
);
Eval( Parse( "dt2 << New Column( \!"Rx 3 Row Pass/Fail\!", Formula( If( Min(" || newList || " ) == 1, 1, 0 ) ) )" ) );回复:最終收益率表問題然而,這就是我目前正在做的事情,因為分析在測試名稱中具有相同 Rx 的多個產品線,其中一個在 Rx 中有 300 種不同的條件,我希望動態地執行此操作,以便它適用於任何現有和即將推出的產品。 .
回复:最終收益率表問題我會以交互方式創建一個新列,然後進入公式編輯器並僅選擇要評估的 Rx 狀態列
回复:最終收益率表問題謝謝。 如果你不介意,你能幫我下一部分嗎?
此代碼採用其中包含“通過/失敗”的所有列 {foundCols} 並找到最小值並 utlimitately 分配通過或失敗。
<SPAN class="token function">Eval</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token function">Parse</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"dt2 << New Column( \!"Row Pass/Fail\!", Formula( If( Min("</SPAN> <SPAN class="token operator">||</SPAN> foundCols <SPAN class="token operator">||</SPAN> <SPAN class="token string">" ) == 1, 1, 0 ) ) )"</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>如何獲得 foundCols 的不同組合,比如我只想要 Rx State 3 的列?
foundCols = {:Name( "7200_VDD_Dig_Rx Pass/Fail" ),
:Name( "7200_Analog_Rx Pass/Fail" ),
:Name( "CH9 Rx State 3 Pass/Fail" ),
:Name( "CH8 Rx State 3 Pass/Fail" ),
:Name( "CH7 Rx State 3 Pass/Fail" ),
:Name( "CH6 Rx State 3 Pass/Fail" ),
:Name( "CH5 Rx State 3 Pass/Fail" ),
:Name( "CH4 Rx State 3 Pass/Fail" ),
:Name( "CH3 Rx State 3 Pass/Fail" ),
:Name( "CH2 Rx State 3 Pass/Fail" ),
:Name( "CH15 Rx State 3 Pass/Fail" ),
:Name( "CH14 Rx State 3 Pass/Fail" ),
:Name( "CH13 Rx State 3 Pass/Fail" ),
:Name( "CH12 Rx State 3 Pass/Fail" ),
:Name( "CH11 Rx State 3 Pass/Fail" ),
:Name( "CH10 Rx State 3 Pass/Fail" ),
:Name( "CH1 Rx State 3 Pass/Fail" ),
:Name( "CH0 Rx State 3 Pass/Fail" ),
:Name( "CH0 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH1 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH10 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH11 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH12 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH13 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH14 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH15 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH2 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH3 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH4 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH5 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH6 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH7 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH8 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "CH9 Rx State 4 Delta Amp Pass/Fail" ),
:Name( "7100_VDD_Dig_Tx Pass/Fail" ),
:Name( "7100_Analog_Tx Pass/Fail" ),
:Name( "CH0 Tx State 1 Pass/Fail" ),
:Name( "CH1 Tx State 1 Pass/Fail" ),
:Name( "CH10 Tx State 1 Pass/Fail" ),
:Name( "CH11 Tx State 1 Pass/Fail" ),
:Name( "CH12 Tx State 1 Pass/Fail" ),
:Name( "CH13 Tx State 1 Pass/Fail" ),
:Name( "CH14 Tx State 1 Pass/Fail" ),
:Name( "CH15 Tx State 1 Pass/Fail" ),
:Name( "CH2 Tx State 1 Pass/Fail" ),
:Name( "CH3 Tx State 1 Pass/Fail" ),
:Name( "CH4 Tx State 1 Pass/Fail" ),
:Name( "CH5 Tx State 1 Pass/Fail" ),
:Name( "CH6 Tx State 1 Pass/Fail" ),
:Name( "CH7 Tx State 1 Pass/Fail" ),
:Name( "CH8 Tx State 1 Pass/Fail" ),
:Name( "CH9 Tx State 1 Pass/Fail" ),
:Name( "801 Pass/Fail" ),
:Name( "802 Pass/Fail" ),
:Name( "803 Pass/Fail" ),
:Name( "804 Pass/Fail" ),
:Name( "805 Pass/Fail" ),
:Name( "806 Pass/Fail" ),
:Name( "807 Pass/Fail" ),
:Name( "821 Pass/Fail" )};
回复:最終收益率表問題您的 Eval(Parse()) 語句中存在一個簡單的語法錯誤。一個“)”被遺漏了。這是一個工作版本
Eval( Parse( "dt2 << New Column( \!"Row Pass/Fail\!", Formula( If( Min(" || foundCols || " ) == 1, 1, 0 ) ) )" ) );