<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: JMP Alert: Subscript Range at row 66 in access or evaluation of 'selected_pqa[/*###*/i]', selected_pqa[/*###*/i] in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-Alert-Subscript-Range-at-row-66-in-access-or-evaluation-of/m-p/699930#M88478</link>
    <description>&lt;P&gt;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.&amp;nbsp; 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.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Nov 2023 15:17:49 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-11-17T15:17:49Z</dc:date>
    <item>
      <title>JMP Alert: Subscript Range at row 66 in access or evaluation of 'selected_pqa[/*###*/i]', selected_pqa[/*###*/i]</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Alert-Subscript-Range-at-row-66-in-access-or-evaluation-of/m-p/699903#M88475</link>
      <description>&lt;P&gt;Hi JMP community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kachveder_0-1700230672403.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58871iA569C644876D01AC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kachveder_0-1700230672403.png" alt="kachveder_0-1700230672403.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a partial JSL script that I think the problem lies:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nw2 = New Window( "Select PQAs",
					&amp;lt;&amp;lt;Modal,
					Text Box("Set PQA(s):"),
					variablebox1_pqa = Check Box( unique_pqa ),
					H List Box(
						variablebox1_pqa_all = Check Box(
							" ",
							&amp;lt;&amp;lt;SetFunction( 
								function({this},
									variablebox1_pqa &amp;lt;&amp;lt; Set All( this &amp;lt;&amp;lt; Get, run script( 1 ) )
								)
							)
						),
						Text Box(
							"Select All PQAs",
							&amp;lt;&amp;lt;Set Width( 90 ),
							&amp;lt;&amp;lt;Set Wrap( 90 )
						)
					),
					H List Box(
					//get all saved variable values when the user 
					//selects the OK button from the menu
						Button Box( "OK", 
							answers = Eval List({
							selected_pqa = variablebox1_pqa &amp;lt;&amp;lt; get selected			
							});
						//	nw &amp;lt;&amp;lt; close window;
						),
						Button Box( "Cancel")
					), 
					//change popup window size
					&amp;lt;&amp;lt;Size Window(600,600)
				);

// If cancel or red X was clicked, stop the script
If( nw2 == {Button( -1 )}, Stop() );


/////////////////////////////////////////////////////////////
//Production of Output
/////////////////////////////////////////////////////////////

//initialize a jmp report window
nw= New Window("JMP report results for each PQA",
    container = V List Box()
);

//loop through each PQA and paste results into the 
//initialized jmp report window at each iteration. 
for (i = 1, i &amp;lt;= N Items(unique_pqa), i++,
	content = V List Box(
		pqa_val = selected_pqa[i];
		dt &amp;lt;&amp;lt; Select Where(:PQA == pqa_val);
		
		//subset the selected data, but make subset data table pop-up invisible
		listDT = dt &amp;lt;&amp;lt; Subset(invisible,
			output table name( "Subset where PQA is " || pqa_val ),
			Selected rows only ( 1 ),
			Selected columns only( 1 )
		);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kachveder_1-1700231016533.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58872i6A2BB243F1C2BCE5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kachveder_1-1700231016533.png" alt="kachveder_1-1700231016533.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Can you help me resolve this alert?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 14:27:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Alert-Subscript-Range-at-row-66-in-access-or-evaluation-of/m-p/699903#M88475</guid>
      <dc:creator>kachveder</dc:creator>
      <dc:date>2023-11-17T14:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Alert: Subscript Range at row 66 in access or evaluation of 'selected_pqa[/*###*/i]', selected_pqa[/*###*/i]</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Alert-Subscript-Range-at-row-66-in-access-or-evaluation-of/m-p/699925#M88476</link>
      <description>&lt;P&gt;Please replace &lt;FONT face="courier new,courier"&gt;unique_pqa&lt;/FONT&gt; with &lt;FONT face="courier new,courier"&gt;selected_pqa&lt;/FONT&gt; in&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for (i = 1, i &amp;lt;= N Items(unique_pqa), i++,
	content = V List Box(
		pqa_val = selected_pqa[i];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise the index &lt;FONT face="courier new,courier"&gt;i&lt;/FONT&gt; will get higher than &lt;FONT face="courier new,courier"&gt;N Items(&lt;CODE class=" language-jsl"&gt;selected_pqa&lt;/CODE&gt;)&lt;/FONT&gt; - which leads to the error that you reported.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 15:06:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Alert-Subscript-Range-at-row-66-in-access-or-evaluation-of/m-p/699925#M88476</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-11-17T15:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: JMP Alert: Subscript Range at row 66 in access or evaluation of 'selected_pqa[/*###*/i]', selected_pqa[/*###*/i]</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-Alert-Subscript-Range-at-row-66-in-access-or-evaluation-of/m-p/699930#M88478</link>
      <description>&lt;P&gt;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.&amp;nbsp; 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.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 15:17:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-Alert-Subscript-Range-at-row-66-in-access-or-evaluation-of/m-p/699930#M88478</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-17T15:17:49Z</dc:date>
    </item>
  </channel>
</rss>

