可以肯定的是,對於那些“知道”的人來說,這是一個簡單的解決方法,但是,我一直在努力弄清楚。 我在做我的限制時有一個 pass_fail 列,需要弄清楚如何將“失敗”分配給缺失的數據。我使用同一個表來繪製分佈,因此為缺失的數據分配一個隨機數可能會導致問題。
提前致謝
列( dt_split, N Cols( dt_split ) ) << Set Property( "Value Labels", {1 = "Pass", 0 = "Fail", -999 = "Fail" });
colList = dt_split << Get Column Names( numeric, string );
foundCols = "";
i = 2;
For( i = 1, i <= N Items( colList ), i++,
Spec = Column( dt_split, colList[i] ) << Get Property( "Spec Limits" );
If( Is Empty( Spec ) == 0,
dt_split << New Column( (Column( dt_split, colList[i] ) << Get Name) || " Pass_Fail" );
If( Is Missing( Try( Spec["LSL"], . ) ) == 0,
dt_split << Select Where( As Column( dt_split, colList[i] ) < Spec["LSL"] );
Try( Column( dt_split, N Cols( dt_split ) )[dt_split << get selected rows] = 0 );
);
If( Is Missing( Try( Spec["USL"], . ) ) == 0,
dt_split << Select Where( As Column( dt_split, colList[i] ) > Spec["USL"], Current Selection( "Extend" ) );
Try( Column( dt_split, N Cols( dt_split ) )[dt_split << Get Selected Rows] = 0 );
);
Wait( 0.5 );
dt_split << Invert Row Selection;
Wait( 0.5 );
ColNotes = Eval( test ) || "_" || "PassFail";
Try( Column( dt_split, N Cols( dt_split ) )[dt_split << Get Selected Rows] = 1 );
Column( dt_split, N Cols( dt_split ) ) << Set Property( "Value Labels", {1 = "Pass", 0 = "Fail", -999 = "Fail" } );
Column( dt_split, N Cols( dt_split ) ) << Set Property( "Value Ordering", {1, 0} );
Column( dt_split, N Cols( dt_split ) ) << Set Property( "Description", "PASS_FAIL" );
Column( dt_split, N Cols( dt_split ) ) << Set Property( "Notes", ColNotes );
If( foundCols == "",
foundCols = ":Name(\!"" || (Column( dt_split, colList[i] ) << Get Name) || " Pass_Fail\!")",
foundCols = foundCols || ", " || ":Name(\!"" || (Column( dt_split, colList[i] ) << Get Name) || " Pass_Fail\!")"
);
);
dt_split << Clear Select;
);
col << Set Property( "Value Labels", {1 = "Pass", 0 = "Fail", 999 = "Fail"});
如果您嘗試對缺失值使用值標籤。您應該能夠直接在 Set 屬性中使用它:
col << Set Property( "Value Labels", {. = "Fail", 1 = "Pass", 0 = "Fail", 999 = "Fail"} );編輯:
另外,如果那些 999 已經丟失了帶有“隨機數”的數據?您還可以使用 Missing Value Codes 列屬性將它們從分析中隱藏:

Set Property("Missing Value Codes", {999})