<?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: For Loops and Column Lists in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769088#M94956</link>
    <description>&lt;P&gt;It worked! Thank you so much!&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2024 20:58:33 GMT</pubDate>
    <dc:creator>ARETI052</dc:creator>
    <dc:date>2024-06-27T20:58:33Z</dc:date>
    <item>
      <title>For Loops and Column Lists</title>
      <link>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769017#M94937</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am intending to build a Graph Builder for visualizing different columns of data each time. The Graph Builder should be able to take whatever many inputs columns (as long as it's less than 8). I built an input GUI but I dont think the y-values are recorded. How can I correctly pass the selected Y column data to the graph builder? Thanks!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ARETI052_0-1719509829133.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65664i4EE70A6580CA5459/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ARETI052_0-1719509829133.png" alt="ARETI052_0-1719509829133.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ARETI052_1-1719509852246.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65665i9BD703D905F541A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ARETI052_1-1719509852246.png" alt="ARETI052_1-1719509852246.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 17:38:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769017#M94937</guid>
      <dc:creator>ARETI052</dc:creator>
      <dc:date>2024-06-27T17:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: For Loops and Column Lists</title>
      <link>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769029#M94939</link>
      <description>&lt;P&gt;Please use the&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1719510632610.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/65666iE4E14A8B897DA0B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1719510632610.png" alt="txnelson_0-1719510632610.png" /&gt;&lt;/span&gt;&amp;nbsp;icon to display your JSL.&amp;nbsp; It allows for the reader to test your code and provide responses.&amp;nbsp; Pasting in images of your code will not allow this, and therefore many possible responders will opt not to respond because of the time it would take to retype in your JSL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 17:53:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769029#M94939</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-06-27T17:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: For Loops and Column Lists</title>
      <link>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769030#M94940</link>
      <description>&lt;P&gt;The embedded log is showing "Specified Column not found in data table. in access or evaluation of 'For' , For/*###*/(j = 1, j &amp;lt;= Min( 8, N Items( yCol ) ), j++, Y( Eval( yCol[j] ) ))"&lt;/P&gt;&lt;P&gt;But I used the column is clearly in my data table.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 17:58:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769030#M94940</guid>
      <dc:creator>ARETI052</dc:creator>
      <dc:date>2024-06-27T17:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: For Loops and Column Lists</title>
      <link>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769041#M94942</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names Default To Here(1);

MyGraph = Function ({yCol,xCol},{default local},
	
	vlb = VListBox(
		Graph Builder(
	Size( 1255, 981 ),
	Show Control Panel( 0 ),
	Variables(
		X( Eval(xCol) ),
		For(j = 1, j &amp;lt;= Min(8, N Items(yCol)), j++,
                Y( Eval(yCol[j]))  // Evaluate each yVar
            ),
		Group X( :Temperature )
	),
	Elements( Points( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Y( 5 ), Y( 6 ), Y( 7 ), Y( 8 ), Legend( 11 ) ) ),
	Local Data Filter(
		Add Filter(
			columns( :Test Stage, :Sublot, :Temperature, :Soft Bin ),
			Display( :Test Stage, N Items( 4 ) ),
			Display( :Soft Bin, N Items( 15 ) )
		)
	)
)
		);
	
	
	return(vlb);
);




dt = CurrentDatatable();
nw = NewWindow("Column Selection", &amp;lt;&amp;lt;modal,
	&amp;lt;&amp;lt;onClose(
		lstX = clbX &amp;lt;&amp;lt; getItems;
		lstY = clbY &amp;lt;&amp;lt; getItems;
	),
	BorderBox(top(10),bottom(10),left(10),right(10),
		VListBox(
			TextBox("Select X and Y variables"),
			HListBox(
				PanelBox("Select Columns",
					fcs = FilterColSelector()
				),
				SpacerBox(size(10,0)),
				PanelBox("Cast Selected Columns into Roles",
					HListBox(
						ButtonBox("Y,Response",
							sel = fcs &amp;lt;&amp;lt; getSelected; 
							clbY &amp;lt;&amp;lt; append(sel);
						),
						SpacerBox(size(6,0)),
						clbY = CollistBox(numeric,maxitems(8),minitems(1),nlines(8))
					
					),
					HListBox(
						ButtonBox("X,Variable",
							sel = fcs &amp;lt;&amp;lt; getSelected; 
							clbX &amp;lt;&amp;lt; append(sel);
							
						),
						SpacerBox(size(6,0)),
						clbX = CollistBox(maxitems(2),minitems(1),nlines(2))	
				
					)
				)	
			)
		) 	
	)
);
if (nw["Button"]==-1,throw());
if (Nitems(lstX)==0,throw());
if (Nitems(lstY)==0,throw());

yColName = lstY; 
xColName = lstX;
show(lstY,lstX);
NewWindow("My report",
	VListBox(
		MyGraph(yColName,xColName),
		HCenterBox(
		btn = ButtonBox("show distribution")
		)
	)
);

btn &amp;lt;&amp;lt; setScript(
MyHistograms()
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jun 2024 18:13:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769041#M94942</guid>
      <dc:creator>ARETI052</dc:creator>
      <dc:date>2024-06-27T18:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: For Loops and Column Lists</title>
      <link>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769042#M94943</link>
      <description>&lt;P&gt;Thanks for the advice, here is my full script.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 18:14:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769042#M94943</guid>
      <dc:creator>ARETI052</dc:creator>
      <dc:date>2024-06-27T18:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: For Loops and Column Lists</title>
      <link>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769085#M94954</link>
      <description>&lt;P&gt;You could prepare your Variables first and then use insert into to put them into Graph builder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;MyGraph = Function ({yCol,xCol},{default local},

vars= 	Eval Expr(Variables(
		X( Expr(xCol) ),
		Group X( :Temperature )
	));
	
	pts= Expr(Points( X));

	For(j = 1, j &amp;lt;= Min(8, N Items(yCol)), j++,
               Insert Into(vars, Eval Expr(Y( Expr(yCol[j]))));
            );
	
	gb = Expr(
		Graph Builder(
		));
	Insert Into(gb, Name Expr(vars));	
	VListBox(gb)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jun 2024 20:18:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769085#M94954</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-06-27T20:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: For Loops and Column Lists</title>
      <link>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769086#M94955</link>
      <description>&lt;P&gt;Things like this will get easier once&amp;nbsp;&lt;LI-MESSAGE title="🙏 Expression Indexing: read and write access" uid="697359" url="https://community.jmp.com/t5/JMP-Wish-List/Expression-Indexing-read-and-write-access/m-p/697359#U697359" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;will be available in future version of JMP ...&lt;BR /&gt;Then you don't have to prepare the different parts and then construct your final expression, you can directly create a draft of the final expression and then manipulate it on any level you want.&lt;BR /&gt;&lt;BR /&gt;e.g. add Y column to an existing Graph builder Expression via :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gbExpression= Expr(Graph Builder(Variables(X(:height))));
Insert Into ( gbExpression["Variables"], Expr(Y(:age)))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 20:31:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769086#M94955</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-06-27T20:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: For Loops and Column Lists</title>
      <link>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769088#M94956</link>
      <description>&lt;P&gt;It worked! Thank you so much!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 20:58:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/For-Loops-and-Column-Lists/m-p/769088#M94956</guid>
      <dc:creator>ARETI052</dc:creator>
      <dc:date>2024-06-27T20:58:33Z</dc:date>
    </item>
  </channel>
</rss>

