JMP列のNotesプロパティは、結果のグラフにラベルを自動的に追加する手段として便利です。私が抱えている問題は、親列に関連する新しいデータ列を生成し、親のNotesを自動的に適用することに関するものです。以下のスクリプトでは、次の行が
<< set property( "Notes", Notes );
うまくいくと思いますが、何かが足りないようです。これがメインのスクリプトです。
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\!")"
);
);
);
ご協力いただければ幸いです
さよなら
スパナヘッド
新しい列の後に発生するノート設定を分離するか
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
For Each({colname}, dt << Get Column Names("String"),
curnote = Column(dt, colname) << Get Property("Notes");
new_col = dt << New Column("A", Character, Nominal);
new_col << Set Property("Notes", curnote);
);
または新しい列内に移動する
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
For Each({colname}, dt << Get Column Names("String"),
curnote = Column(dt, colname) << Get Property("Notes");
new_col = dt << New Column("A", Character, Nominal, Set Property("Notes", curnote));
);
スクリプトのアイデアを得るには、メモプロパティを持つ列を選択し、ヘッダーを右クリックしてコピー列のコピーを選択するか、新しい列を作成してすぐにプロパティを追加し、拡張ログからスクリプトを取得できます。
Data Table("Big Class") << New Column("Column 6",
Numeric,
"Continuous",
Format("Best", 12),
Set Property("Notes", "asdasd")
);