こんにちはチーム、
複数の列の減算を行うための1つのスクリプトを開発するための支援が必要です。列名とカウントは可変です。
分析に基づいて変更することができます、
同じ行のすべての値の違いを列デルタに入力する必要があります。
以下のサンプルデータ

やあ@jinsejoseph
使用したい式の例を挙げていただけますか?これは、カスタム変換を使用するもののように聞こえますスクリプトツールのアドイン。

こんにちは、返信ありがとうございます、
私はJMP15を使用していますが、使用できるコードを示すのに役立ちますか?
私はJMPの初心者です
前もって感謝します
やあ 、
私はデータ分析用のスクリプトを書いていましたが、1つのデータテーブルのコードの間にこのロジックを実装するためにこれが必要です。
私が使用できるコードを指すのを手伝ってもらえますか
前もって感謝します
これが私が使用する式です。これは、行列内のすべてのゼロ以外のエントリを返す行列関数Loc()に依存しています。
x = :data[Row()] || :data1[Row()] ||
:data2[Row()] || :data3[Row()] ||
:data4[Row()] || :data5[Row()] ||
:data6[Row()] || :data7[Row()] ||
:data8[Row()] || :data9[Row()];
y = Loc( x );
Try( x[y[2]] - x[y[1]], . );
こんにちはジム、
入力ありがとうございます、
ただし、列名は変数制御であり、実行ごとに名前を変更できます。
その状況でどのようにコーディングするのですか?
名前がわからず、列の数もわからないと仮定すると、次のコードは必要な数式を作成し、生成された数式を使用して新しい列を作成します
Names Default To Here( 1 );
dt = Current Data Table();
// Get the columns
colNames = dt << get column names( string, continuous );
// Build the formula
theExpr = "dt<<NEW column=""></NEW>

使用したサンプルデータ表を添付
複数回使用する必要がある場合は、関数に変換することもできます。
これが1つの例です:
- 関数
- 正規表現を使用して、対象の列にフィルターをかけます
- 各フィルターのためにJMP16が必要
- Loc()と行列計算を使用します
- 値を使用して新しい列デルタを作成します
Names Default To Here(1);
//example datatable
dt = New Table("Untitled",
Add Rows(5),
Compress File When Saved(1),
New Column("Column 1",
Numeric,
"Continuous",
Format("Best", 12),
Set Values([1, 0, 0, 1, 0]),
Set Display Width(55)
),
New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([0, 2, 3, 0, 0])),
New Column("Column 3",
Numeric,
"Continuous",
Format("Best", 12),
Set Values([0, 3, 0, 0, 0]),
Set Display Width(87)
),
New Column("Column 4", Numeric, "Continuous", Format("Best", 12), Set Values([3, 0, 4, 0, 0])),
New Column("col", Character, "Nominal", Set Values({"a", "a", "a", "a", "a"}))
);
difference_between_min_max = Function({dt_ref, col_prefix_regex},
{Default Local},
//get columnn names of interest based on col_prefix
col_names_all = dt_ref << Get Column Names("Numeric", "String");
col_names_of_interest = Filter Each({val}, col_names_all,
!IsMissing(Regex(val, col_prefix_regex));
);
show(col_names_of_interest);
//all values for columns of interest, transpose for calculations
m = Transpose(dt_ref[0, col_names_of_interest]);
//replace 0 with missing to avoid calculation with those
m[Loc(m, 0)] = .;
//Get max and min values and deduct them
result = V Max(m) - V Min(m);
//Replace missing values with 0 for final results
result[Loc(result,.)] = 0;
//we could return result matrix here OR we can create new column with the function
dt_ref << New Column("delta", Numeric, Continuos, Set Values(result));
);
//example table in this example
difference_between_min_max(dt, "(Column )");
//example table by txnelson
//difference_between_min_max(Current Data Table(), "^(\D{1})$");
それをに変えることもできますカスタム機能
わかりました。その場合、私は個人的にカスタム変換関数を使用します。スクリプトツール加える。変換するすべての列(data1-data10だと思います)を選択してから、[列]メニュー(アドインのインストール後に使用可能)から[カスタム変換]を選択し、次の設定を入力します。
