JMP Alert: Subscript Range at row 66 in access or evaluation of 'selected_pqa[/*###*/i]', selected_pqa[/*###*/i]Hi JMP community,
I am having another issue with JMP scripting that is giving me the following error, even though I am getting the resulting output (charts and test results) I need:

Here is a partial JSL script that I think the problem lies:
nw2 = New Window( "Select PQAs",
<<MODAL></MODAL>This is the window where I can select PQAs, or all PQAs. I do not get the alert when I select all PQAs. I get the alert when I select a handful of PQAs.

Can you help me resolve this alert?
Thank you.
Automation and ScriptingData Exploration and VisualizationRe: JMP Alert: Subscript Range at row 66 in access or evaluation of 'selected_pqa[/*###*/i]', selected_pqa[/*###*/i]Please replace unique_pqa with selected_pqa in
for (i = 1, i <= N Items(unique_pqa), i++,
content = V List Box(
pqa_val = selected_pqa[i];
Otherwise the index i will get higher than N Items(selected_pqa) - which leads to the error that you reported.
Re: JMP Alert: Subscript Range at row 66 in access or evaluation of 'selected_pqa[/*###*/i]', selected_pqa[/*###*/i]I believe the issue is that you are looping in your For() loop, from 1 to N Items in unique_pqa, but you are doing your selection from selected_pqa. If you have 10 items in your Check Box(), and you only select 2 of them, there will be 8 Select Where() calls that are not selecting, and therefore your susets will not run correctly.