안녕하세요,
사용자를 위한 간단한 인터페이스를 구축 중이며 확인란을 사용하여 몇 가지 옵션을 설정할 수 있는 창이 있습니다.
현재 첫 번째 호출 기능을 만들 수 있으며 스크립트는 열에서 문자열 "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() 루프에 대해 다른 변수를 사용해야 합니다.