<?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: Stack output table name in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773528#M95476</link>
    <description>I am fairly new to JSL scripting and still in the process of getting familiar with it. But I agree your solution looks more easy to debug. Thanks</description>
    <pubDate>Wed, 17 Jul 2024 07:58:23 GMT</pubDate>
    <dc:creator>skollcruz23</dc:creator>
    <dc:date>2024-07-17T07:58:23Z</dc:date>
    <item>
      <title>Stack output table name</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773480#M95462</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a script that dynamically parses some of the info for stack table and would like to store the stack table as a new data table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ystr1 = ":INFRASTRUCTURE Value, :INFRASTRUCTURE Value 1"&lt;/P&gt;&lt;DIV&gt;infr = "Infrastructure Value";&lt;/DIV&gt;&lt;DIV&gt;data = "PPT";&lt;/DIV&gt;&lt;DIV&gt;output_name = "infra_updated.jmp";&lt;/DIV&gt;&lt;DIV&gt;gbStr = EvalInsert("dt &amp;lt;&amp;lt; Stack(&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;columns(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;^ystr1^&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Source Label Column(^infr^ ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Stacked Data Column(^data^),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Output Table(^output_name^ )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Eval(Parse(gbStr));&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the following error&amp;nbsp;&lt;/P&gt;&lt;P&gt;Name Unresolved: infra_updated..jmp in access or evaluation of 'infra_updated.jmp'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unable to figure out why EvalInsert doesn't work for Output Table&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 03:01:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773480#M95462</guid>
      <dc:creator>skollcruz23</dc:creator>
      <dc:date>2024-07-17T03:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Stack output table name</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773490#M95463</link>
      <description>&lt;P&gt;Quotes need to be around the Output Table() specified name.&amp;nbsp; Therefore, they need to be added to the string value for your output_name variable&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ystr1 = ":INFRASTRUCTURE Value, :INFRASTRUCTURE Value 1";

infr = "Infrastructure Value";
data = "PPT";
output_name = "\!"infra_updated\!"";
gbStr = Eval Insert(
	"dt &amp;lt;&amp;lt; Stack(
columns(
^ystr1^
),
Source Label Column(^infr^ ),
Stacked Data Column(^data^),
Output Table(^output_name^ )
)"
);
 
Eval( Parse( gbStr ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jul 2024 03:27:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773490#M95463</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-07-17T03:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Stack output table name</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773492#M95464</link>
      <description>&lt;P&gt;Jim already gave the reason what is going wrong in your script. I would suggest you use other methods than Eval(Parse()) as it can be extremely difficult to debug and you don't have syntax highlighting in script editor&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

/*
dt = Open("$SAMPLE_DATA/Big Class.jmp");
cols = {"age", "height"};
*/

cols = {"INFRASTRUCTURE Value", "INFRASTRUCTURE Value 1"};
infr = "Infrastructure Value";
data = "PPT";
output_name = "infra_updated";


dt_stacked = dt &amp;lt;&amp;lt; Stack(
	Columns(Eval(cols)),
	Source Label Column(infr),
	Stacked Data Column(data),
	Output Table(output_name)
);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 04:42:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773492#M95464</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-17T04:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Stack output table name</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773526#M95475</link>
      <description>Thank you for explaining the issue.</description>
      <pubDate>Wed, 17 Jul 2024 07:53:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773526#M95475</guid>
      <dc:creator>skollcruz23</dc:creator>
      <dc:date>2024-07-17T07:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Stack output table name</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773528#M95476</link>
      <description>I am fairly new to JSL scripting and still in the process of getting familiar with it. But I agree your solution looks more easy to debug. Thanks</description>
      <pubDate>Wed, 17 Jul 2024 07:58:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773528#M95476</guid>
      <dc:creator>skollcruz23</dc:creator>
      <dc:date>2024-07-17T07:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Stack output table name</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773589#M95489</link>
      <description>&lt;P&gt;I tried your solution but i am seeing this error.&amp;nbsp; I do have the correct column names in the list.&lt;/P&gt;&lt;P&gt;"Column not found in access or evaluation of 'Stack' , Bad Argument"&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 13:35:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773589#M95489</guid>
      <dc:creator>skollcruz23</dc:creator>
      <dc:date>2024-07-17T13:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Stack output table name</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773595#M95491</link>
      <description>&lt;P&gt;For me it works fine in JMP18 (and 17) when I test it with the example I left in the code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

cols = {"age", "height"};
infr = "Infrastructure Value";
data = "PPT";
output_name = "infra_updated";

dt_stacked = dt &amp;lt;&amp;lt; Stack(
	Columns(Eval(cols)),
	Source Label Column(infr),
	Stacked Data Column(data),
	Output Table(output_name)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1721224885130.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/66254i84F9506ADEFDC859/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1721224885130.png" alt="jthi_0-1721224885130.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Are you sure the column names are written correctly and they are in a list?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2024 14:02:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-output-table-name/m-p/773595#M95491</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-07-17T14:02:46Z</dc:date>
    </item>
  </channel>
</rss>

