Estoy bastante seguro de que esta es una solución simple para aquellos que "saben", sin embargo, he estado luchando por resolverlo. Tengo una columna pass_fail cuando estoy cumpliendo mis límites y necesito averiguar cómo asignar "Fail" a los datos faltantes. Utilizo la misma tabla para trazar distribuciones, por lo que asignar un número aleatorio a los datos faltantes podría causar problemas.
Gracias de antemano
Columna (dt_split, N Cols (dt_split)) << Establecer propiedad ("Etiquetas de valor", {1 = "Pasa", 0 = "Falla", -999 = "Falla"});
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 << Establecer propiedad ("Etiquetas de valor", {1 = "Pasa", 0 = "Falla", 999 = "Falla"});