I find the Notes property in a JMP column useful as a means to automatically add labels to the resulting graphs. The issue I'm having relates to generating new data columns related to parent columns and having the parent Notes automatically apply across. In the script below, I had hoped that the line
<< set property( "Notes", Notes );
would do the trick but I'm missing something. Here's the main script.
Names Default To Here( 1 );
dt = Current Data Table();
colList = dt << get column names( numeric, string );
foundCols = "";
For( i = 1, i <= N Col( dt ), i++,
Spud = ":" || colList[i];
Spuds = Parse( Eval Insert( Spud ) );
Show(Spuds);
spec = Column( dt, colList[i] ) << get property( "Spec Limits" );
Notes = Column( dt, colList[i] ) << get property( "Notes" );
Show(Notes);
dt << clear select;
If( Is Empty( spec ) == 0,
dt << New Column(
(Column( dt, colList[i] ) << get name) || " % Delta From Target",
Formula(
If( Spuds > (Spuds << get property( "Spec Limits" ))["Target"],
Num(
(Spuds - (Spuds << get property( "Spec Limits" ))["Target"])
/ ((Spuds << get property( "Spec Limits" ))["USL"] - (Spuds
<< get property( "Spec Limits" ))["Target"])
) * 100,
If( Spuds < (Spuds << get property( "Spec Limits" ))["Target"],
Num(
((Spuds << get property( "Spec Limits" ))["Target"]
-Spuds) / ((Spuds << get property( "Spec Limits" ))[
"LSL"] - (Spuds << get property( "Spec Limits" ))[
"Target"]) * 100
),
0
)
)
)
) << set property( "Notes", Notes );
If( Is Missing( Try( spec["LSL"], . ) ) == 0,
dt << select where( As Column( dt, colList[i] ) + spec["LSL"] );
Try( Column( dt, N Cols( dt ) )[dt << get selected rows] = 0 );
);
If( Is Missing( Try( spec["USL"], . ) ) == 0,
dt << select where(
As Column( dt, colList[i] ) - spec["USL"],
current selection( "extend" )
);
Try( Column( dt, N Cols( dt ) )[dt << get selected rows] = 0 );
);
dt << select where(
Is Missing( As Column( dt, colList[i] ) ),
current selection( "extend" )
);
dt << invert row selection;
Try( Column( dt, N Cols( dt ) )[dt << get selected rows] = 1 );
Column( dt, N Cols( dt ) );
If( foundCols == "",
foundCols = ":Name(\!"" || (Column( dt, colList[i] ) << get name) ||
" % Delta From Target\!")",
foundCols = foundCols || ", " || ":Name(\!"" || (
Column( dt, colList[i] ) << get name) || " % Delta From Target\!")"
);
);
);
Any help appreciated
Slán
SpannerHead
Slán
SpannerHead