やあ、
ユーザー向けのシンプルなインターフェイスを構築しており、チェックボックスを使用していくつかのオプションを設定するためのウィンドウがあります。
現在、最初の呼び出し関数を作成することができ、スクリプトは列から文字列「SE」をフィルタリングして、外れ値を生成します。 ただし、2番目と3番目のチェックボックスをオンにすると、関数が呼び出されません。
次のスクリプトを試しました。
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Water Treatment.jmp");
check_list = {"SS", "SE", "PH"};
todo_list = {};
nw = new window("Checkboxes", << modal(),
my_cb = checkbox(check_list),
panelbox("Actions",
hlistbox(
button box("OK",
keep_going = 1;
todo_list = my_cb << get selected;
),
button box("Cancel", keep_going = 0)
),
),
);
nt = nitems(todo_list);
colList = dt << Get Column Names("String");
filteredCols = {};
if (keep_going & nt > 0,
for (i = 1, i <= nt, i++,
if (todo_list[i] == "SS",
// Call function for One step
For(i = 1, i <= N Items(colList), i++,
If(Contains(colList[i], "SS"), Insert Into(filteredCols, colList[i]))
);
obj = dt <<
Explore Outliers(
Y((Eval(filteredCols) )));
obj << Quantile Range Outliers;
obj << Select Rows(All);
,
todo_list[i] == "SE",
// Call function for Two step
For(i = 1, i <= N Items(colList), i++,
If(Contains(colList[i], "SE"), Insert Into(filteredCols, colList[i]))
);
obj = dt <<
Explore Outliers(
Y((Eval(filteredCols) )));
obj << Quantile Range Outliers;
obj << Select Rows(All);
,
todo_list[i] == "PH",
// Call function for Three step
For(i = 1, i <= N Items(colList), i++,
If(Contains(colList[i], "PH"), Insert Into(filteredCols, colList[i]))
);
obj = dt <<
Explore Outliers(
Y((Eval(filteredCols) )));
obj << Quantile Range Outliers;
obj << Select Rows(All);
);
);
);いくつか探していますフィードバック
ありがとう、
ジャック
すべてのFor()ループにインデックス「i」を使用しています。つまり、「i」の値はあちこちで変更されているということです。ループ内にループがある場合は、For()ループに異なる変数を使用する必要があります。