<?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: Save Analysis to Table Using Variable (in JSL) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Save-Analysis-to-Table-Using-Variable-in-JSL/m-p/38583#M22583</link>
    <description>&lt;P&gt;You need to evaluate your column references before adding a new table script. See example below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
myvar = dt &amp;lt;&amp;lt; Get column Names();

Eval(
	Eval Expr(
		dt &amp;lt;&amp;lt; New Script(
			"Save Analyses Using Variable",
			Names Default To Here( 1 );
			dt = current data table();
			biv = dt &amp;lt;&amp;lt; Bivariate( Y( Expr( myvar[2] ) ), X( Expr( myvar[4] ) ), Fit Line );
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Apr 2017 14:58:57 GMT</pubDate>
    <dc:creator>Justin_Chilton</dc:creator>
    <dc:date>2017-04-27T14:58:57Z</dc:date>
    <item>
      <title>Save Analysis to Table Using Variable (in JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/Save-Analysis-to-Table-Using-Variable-in-JSL/m-p/38574#M22579</link>
      <description>&lt;P&gt;All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Trying to figure out how to save an analyses to a data table using a variable . I tried multiple options :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;1. Option 1 : Adding Col List to table as a variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");
myvar = dt &amp;lt;&amp;lt; Get column Names("String");
dt &amp;lt;&amp;lt; Set Table Variable("ColNames", myvar);
dt &amp;lt;&amp;lt; New Script("Save Analyses Using Variable",
Bivariate(myvar[2],myvar[4],Fit Line)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;2. Using the column name from a list&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;BivAfter = Bivariate(
                           Y( Eval(TempCols[r])), //&amp;nbsp;
                           X( :age ),
                          Automatic Recalc( 1 ),
                           Fit Line( {Line Color( {213, 72, 87} )} )
                           );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Option 2 works when you are running the script and saves the analyses to the data table . But if I close the script and try to launch the analyses from the table - it fails .&amp;nbsp;&lt;BR /&gt;Can anybody help please ?&amp;nbsp;&lt;BR /&gt;Best&amp;nbsp;&lt;BR /&gt;Uday&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2017 14:31:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-Analysis-to-Table-Using-Variable-in-JSL/m-p/38574#M22579</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-04-27T14:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Save Analysis to Table Using Variable (in JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/Save-Analysis-to-Table-Using-Variable-in-JSL/m-p/38583#M22583</link>
      <description>&lt;P&gt;You need to evaluate your column references before adding a new table script. See example below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
myvar = dt &amp;lt;&amp;lt; Get column Names();

Eval(
	Eval Expr(
		dt &amp;lt;&amp;lt; New Script(
			"Save Analyses Using Variable",
			Names Default To Here( 1 );
			dt = current data table();
			biv = dt &amp;lt;&amp;lt; Bivariate( Y( Expr( myvar[2] ) ), X( Expr( myvar[4] ) ), Fit Line );
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Apr 2017 14:58:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-Analysis-to-Table-Using-Variable-in-JSL/m-p/38583#M22583</guid>
      <dc:creator>Justin_Chilton</dc:creator>
      <dc:date>2017-04-27T14:58:57Z</dc:date>
    </item>
  </channel>
</rss>

