<?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 Stack column using table variable list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109031#M39584</link>
    <description>&lt;P&gt;I would like to stack a list of columns based on a table variable, but I'm having trouble figuring out how to format the variable and the script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//this is my table variable -- I've called it myList
{"colName1", "colName2"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//this is my script
dt = Current Data Table();
dt &amp;lt;&amp;lt; Stack(
	columns(myList),
	Output Table( "New Table" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have a table with column names colName1, colName2, colName3...&lt;/P&gt;&lt;P&gt;And I would like to be able to stack only certain columns based on a table variable list. I've been able to do this by grouping columns then stacking the whole group, but I've run into situations where I may want to stack a subset of a group of columns, hence this attempt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The list and script above gives me the error: "Column not found in access or evaluation of bad argument"&lt;/P&gt;&lt;P&gt;I've also tried changing the command to&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;columns(eval(myList))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but that gives me the same error&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Feb 2019 14:43:57 GMT</pubDate>
    <dc:creator>snapnpop</dc:creator>
    <dc:date>2019-02-06T14:43:57Z</dc:date>
    <item>
      <title>Stack column using table variable list</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109031#M39584</link>
      <description>&lt;P&gt;I would like to stack a list of columns based on a table variable, but I'm having trouble figuring out how to format the variable and the script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//this is my table variable -- I've called it myList
{"colName1", "colName2"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//this is my script
dt = Current Data Table();
dt &amp;lt;&amp;lt; Stack(
	columns(myList),
	Output Table( "New Table" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have a table with column names colName1, colName2, colName3...&lt;/P&gt;&lt;P&gt;And I would like to be able to stack only certain columns based on a table variable list. I've been able to do this by grouping columns then stacking the whole group, but I've run into situations where I may want to stack a subset of a group of columns, hence this attempt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The list and script above gives me the error: "Column not found in access or evaluation of bad argument"&lt;/P&gt;&lt;P&gt;I've also tried changing the command to&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;columns(eval(myList))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but that gives me the same error&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 14:43:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109031#M39584</guid>
      <dc:creator>snapnpop</dc:creator>
      <dc:date>2019-02-06T14:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Stack column using table variable list</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109035#M39586</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/13935"&gt;@snapnpop&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Shouldn't your table variable look like this ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {"Column1", "Column2"} vs {"Column1, Column2"} ?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 14:41:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109035#M39586</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2019-02-06T14:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Stack column using table variable list</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109039#M39588</link>
      <description>&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&lt;BR /&gt;I've fixed my original post. My table variable was as you typed out.&lt;BR /&gt;I had also tried:&lt;BR /&gt;("colName1","colName1")&lt;BR /&gt;Both with the same errors</description>
      <pubDate>Wed, 06 Feb 2019 14:55:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109039#M39588</guid>
      <dc:creator>snapnpop</dc:creator>
      <dc:date>2019-02-06T14:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Stack column using table variable list</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109059#M39590</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;
&lt;P&gt;you can try with this code&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;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();

// column dialog editor
cd = Column Dialog(
Var = collist( " select columns &amp;gt;&amp;gt;", MinCol( 1 ) ), Hlist( "" ), );
collist= cd["Var"];

//stack operation
dt_stack = dt &amp;lt;&amp;lt; Stack(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; columns( collist ), Output Table( "STacked" ),
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 17:30:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109059#M39590</guid>
      <dc:creator>gianpaolo</dc:creator>
      <dc:date>2019-02-06T17:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Stack column using table variable list</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109064#M39594</link>
      <description>@gianpalo: the code you've posted allows me to manually select columns to stack each time I run the script.&lt;BR /&gt;&lt;BR /&gt;My goal is to have a table variable with a list of column names to stack, then run a script that utilizes that variable.&lt;BR /&gt;The intent is to be able to edit the variable to add/remove columns to be stacked, as the dataset expands/contracts.</description>
      <pubDate>Wed, 06 Feb 2019 17:22:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109064#M39594</guid>
      <dc:creator>snapnpop</dc:creator>
      <dc:date>2019-02-06T17:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Stack column using table variable list</title>
      <link>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109092#M39605</link>
      <description>&lt;P&gt;Taking a hint from&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/List-as-data-table-variable/td-p/43948" target="_self"&gt;this thread&lt;/A&gt;, I figured out that using the Parse() command works for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table variable &lt;STRONG&gt;myList&lt;/STRONG&gt; formatted as such:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;{"colName1","colName2"}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and script looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; Stack
	( columns( Parse(myList) ), 
	Output Table( "Stacked Data" )
	);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Feb 2019 21:27:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Stack-column-using-table-variable-list/m-p/109092#M39605</guid>
      <dc:creator>snapnpop</dc:creator>
      <dc:date>2019-02-06T21:27:34Z</dc:date>
    </item>
  </channel>
</rss>

