最终收益率表问题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 ) ) )" ) );