Salut,
Je suis en train de créer une interface utilisateur simple, avec une fenêtre permettant de paramétrer certaines options à l'aide de cases à cocher.
Actuellement, je parviens à exécuter la première fonction : le script filtre la chaîne « SE » des colonnes et génère les valeurs aberrantes. Cependant, si je coche les deuxième et troisième cases, la fonction n'est pas appelée.
J'ai essayé le script suivant :
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);
);
);
);
Je cherche des retours d'expérience.
Merci,
Jack
Vous utilisez l'index "i" pour toutes vos boucles For().Cela signifie que la valeur de "i" est en train de changer partout.Vous devez utiliser différentes variables pour vos boucles For() lorsqu'il y a une boucle dans une boucle.