<?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: Graph Builder how do i make it detect the variables and insert them in? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Graph-Builder-how-do-i-make-it-detect-the-variables-and-insert/m-p/627585#M82610</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47090"&gt;@Dyan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Is the following graphic what you want to create? If so, here is a sample script.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="111424.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/52477iD42D893903CD1FC2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="111424.png" alt="111424.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;x_vars = "";
y_vars = "";
		
xlist = {X, X1, X2, X3, X4} = Eval List( {colX[i], colX1[i], colX2[i], colX3[i], colX4[i]} );
ylist = {Y, Y1, Y2, Y3, Y4} = Eval List( {colY[i], colY1[i], colY2[i], colY3[i], colY4[i]} );

For( x_i = 1, x_i &amp;lt;= N Items( xlist ), x_i++,
	If( !Is Empty( xlist[x_i] ),
		x_vars = x_vars || "X(" || Char( Eval Expr( xlist[x_i] ) ) || "),"
	)
);

For( y_i = 1, y_i &amp;lt;= N Items( ylist ), y_i++,
	If( !Is Empty( ylist[y_i] ),
		y_vars = y_vars || "Y(" || Char( Eval Expr( ylist[y_i] ) ) || "),"
	)
);
		
Show( x_vars );
Show( y_vars );

Eval(
	Parse(
		Eval Insert( "\[GB = Current Data Table() &amp;lt;&amp;lt; Graph Builder(
				Size( 621, 472 ),
				Variables(  ^x_vars^  ^y_vars^  ), 		
				)
	;]\" )
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The following discussion page refers to a similar question.&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/JSL-Script-Graph-Builder-to-plot-all-columns-of-a-data-table/td-p/254038" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/JSL-Script-Graph-Builder-to-plot-all-columns-of-a-data-table/td-p/254038&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also learn about expressions on the page below.&amp;nbsp;&lt;A href="https://community.jmp.com/t5/JSL-Cookbook-Archived/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/ta-p/48998" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/JSL-Cookbook-Archived/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/ta-p/48998&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope it helps.&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2023 02:29:56 GMT</pubDate>
    <dc:creator>yuichi_katsumur</dc:creator>
    <dc:date>2023-05-01T02:29:56Z</dc:date>
    <item>
      <title>Graph Builder how do i make it detect the variables and insert them in?</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-how-do-i-make-it-detect-the-variables-and-insert/m-p/626530#M82533</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;nbsp;       NX = 5; //NX NY are to specify the matrix indices for Graph builder
		NY = 5;
			
		If( Is Missing(colX1[i]), NX = NX - 1 );
		If( Is Missing(colX2[i]), NX = NX - 1 );
		If( Is Missing(colX3[i]), NX = NX - 1 );
		If( Is Missing(colX4[i]), NX = NX - 1 );
		
		show(NX);
		
		If( Is Missing(colY1[i]), NY = NY - 1 );
		If( Is Missing(colY2[i]), NY = NY - 1 );
		If( Is Missing(colY3[i]), NY = NY - 1 );
		If( Is Missing(colY4[i]), NY = NY - 1 );
		
		show(NY);
		
		x_vars = {}; // make empty list for x and y variables 
		y_vars = {};
		
		X = colX[i];
		X1 = colX1[i];
		X2 = colX2[i];
		X3 = colX3[i];
		X4 = colX4[i];
		
		Y = colY[i];
		Y1 = colY1[i];
		Y2 = colY2[i];
		Y3 = colY3[i];
		Y4 = colY4[i];
		
		If( !Is Missing(colX[i]), Insert Into( x_vars, X ) ); 
		If(	!Is Missing(colX1[i]), Insert Into( x_vars, X1) );
		If(	!Is Missing(colX2[i]),Insert Into( x_vars, X2) );
		If(	!Is Missing(colX3[i]), Insert Into( x_vars, X3) );
		If(	!Is Missing(colX4[i]), Insert Into( x_vars, X4) ); 

		If( !Is Missing(colY[i]), Insert Into( y_vars, Y) ); 
		If(	!Is Missing(colY1[i]), Insert Into( y_vars, Y1) );
		If(	!Is Missing(colY2[i]), Insert Into( y_vars, Y2) );
		If(	!Is Missing(colY3[i]), Insert Into( y_vars, Y3) );
		If(	!Is Missing(colY4[i]), Insert Into( y_vars, Y4) );  
		
		show(x_vars);
		show(y_vars);

		GB = Current Data Table() &amp;lt;&amp;lt; Graph Builder(
			Size( 621, 472 ),
			Variables(
				X(x_vars),
				Y(y_vars)	
			),
			// the for loops is used together with the NX and NY part from above
			For( i = 1, i &amp;lt;= NX, i++,
				For( j = 1, j &amp;lt;= NY , j++,
					If( i == 1 &amp;amp; j == 1,
						Elements(
							Position( i, j ),
							Points( X, Y, Legend( 67 ) ),
							Smoother( X, Y, Legend( 68 ) )
						),
						Elements(
							Position( i, j ),
							Points( X, Y, Legend( 68 + (i - 1) * 5 + (j - 2) ) ),
							Smoother( X, Y, Legend( 69 + (i - 1) * 5 + (j - 2) ) )
						)
					)
				)
			),
			
			SendToReport(
				Dispatch(
					{},
					"Graph",
					ScaleBox,
					{Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
				)
			)
			
		);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hi all, how can script it in such a way that it detects which of my variables is not empty and adds it in the X( ) and Y( ) of Variables shown below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i have now is shown above where it will detect which is not missing and add it to a list then from that list try to add it into variables shown below how do i continue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for reading&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;nbsp;           Variables(
				X(x_vars),
				Y(y_vars)	
			),&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:09:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-how-do-i-make-it-detect-the-variables-and-insert/m-p/626530#M82533</guid>
      <dc:creator>Dyan</dc:creator>
      <dc:date>2023-06-09T16:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Graph Builder how do i make it detect the variables and insert them in?</title>
      <link>https://community.jmp.com/t5/Discussions/Graph-Builder-how-do-i-make-it-detect-the-variables-and-insert/m-p/627585#M82610</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/47090"&gt;@Dyan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Is the following graphic what you want to create? If so, here is a sample script.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="111424.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/52477iD42D893903CD1FC2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="111424.png" alt="111424.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;x_vars = "";
y_vars = "";
		
xlist = {X, X1, X2, X3, X4} = Eval List( {colX[i], colX1[i], colX2[i], colX3[i], colX4[i]} );
ylist = {Y, Y1, Y2, Y3, Y4} = Eval List( {colY[i], colY1[i], colY2[i], colY3[i], colY4[i]} );

For( x_i = 1, x_i &amp;lt;= N Items( xlist ), x_i++,
	If( !Is Empty( xlist[x_i] ),
		x_vars = x_vars || "X(" || Char( Eval Expr( xlist[x_i] ) ) || "),"
	)
);

For( y_i = 1, y_i &amp;lt;= N Items( ylist ), y_i++,
	If( !Is Empty( ylist[y_i] ),
		y_vars = y_vars || "Y(" || Char( Eval Expr( ylist[y_i] ) ) || "),"
	)
);
		
Show( x_vars );
Show( y_vars );

Eval(
	Parse(
		Eval Insert( "\[GB = Current Data Table() &amp;lt;&amp;lt; Graph Builder(
				Size( 621, 472 ),
				Variables(  ^x_vars^  ^y_vars^  ), 		
				)
	;]\" )
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The following discussion page refers to a similar question.&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/JSL-Script-Graph-Builder-to-plot-all-columns-of-a-data-table/td-p/254038" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/JSL-Script-Graph-Builder-to-plot-all-columns-of-a-data-table/td-p/254038&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also learn about expressions on the page below.&amp;nbsp;&lt;A href="https://community.jmp.com/t5/JSL-Cookbook-Archived/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/ta-p/48998" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/JSL-Cookbook-Archived/Insert-one-expression-into-another-using-Eval-Insert-Eval-Expr/ta-p/48998&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope it helps.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 02:29:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Graph-Builder-how-do-i-make-it-detect-the-variables-and-insert/m-p/627585#M82610</guid>
      <dc:creator>yuichi_katsumur</dc:creator>
      <dc:date>2023-05-01T02:29:56Z</dc:date>
    </item>
  </channel>
</rss>

