<?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: How to place List values into the column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36175#M21259</link>
    <description>&lt;P&gt;Following on &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;post...I actually created a little function to do this, as I found myself in the same position many times. This will "flatten" list of lists 2 levels deep for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Flatten2DList = Function( {list_arg},
	{DefaultLocal},
	NewList = {};
	For( i = 1, i &amp;lt;= N Items( list_arg), i++, 
		For( j = 1, j &amp;lt;= N Items( list_arg[i] ), j++, 
			Insert Into( NewList, list_arg[i][j] );
		);
	);
	NewList;
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Feb 2017 14:52:39 GMT</pubDate>
    <dc:creator>Phil_Brown</dc:creator>
    <dc:date>2017-02-21T14:52:39Z</dc:date>
    <item>
      <title>How to place List values into the column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36060#M21230</link>
      <description>&lt;P&gt;As a result of some manipulations I have a list of size of number of rows in my table.&lt;/P&gt;&lt;P&gt;I want to create a new column and place these values into this colum.&lt;/P&gt;&lt;P&gt;JSL reference says that this should work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;dt = New Table( "My Data");
dt &amp;lt;&amp;lt; New Column( "Last Name", Character, Values( {"Smith", "Jones",
"Anderson"} ) );&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IThe list that I want to put into that column is actually list of lists. If I do Eval(names) I get something like {{"John"}, {"Jim"&amp;nbsp;},{"Jane"}}&lt;/P&gt;&lt;P&gt;How to make it one dimensional list to put into the column?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2017 04:54:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36060#M21230</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2017-02-18T04:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to place List values into the column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36063#M21233</link>
      <description>&lt;P&gt;This should do it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
origlist = {{"John"}, {"Jim"}, {"Jane"}};
newlist = {};
For( i = 1, i &amp;lt;= N Items( origlist ), i++,
	Insert Into( newlist, origlist[i] )
);
dt = New Table( "My Data" );
dt &amp;lt;&amp;lt; New Column( "Last Name", Character, Values( newlist ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Feb 2017 12:32:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36063#M21233</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-18T12:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to place List values into the column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36080#M21241</link>
      <description>&lt;P&gt;disregard&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 06:29:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36080#M21241</guid>
      <dc:creator>maurogerber</dc:creator>
      <dc:date>2017-02-21T06:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to place List values into the column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36123#M21246</link>
      <description>&lt;P&gt;Your code does work, however the issue is that the list, "Origlist" is a list of lists, not just a single list, which is the way your have the list defined in your script.&amp;nbsp; So the issue is, how to get the list of lists into the data table.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 17:05:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36123#M21246</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-20T17:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to place List values into the column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36175#M21259</link>
      <description>&lt;P&gt;Following on &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;post...I actually created a little function to do this, as I found myself in the same position many times. This will "flatten" list of lists 2 levels deep for example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Flatten2DList = Function( {list_arg},
	{DefaultLocal},
	NewList = {};
	For( i = 1, i &amp;lt;= N Items( list_arg), i++, 
		For( j = 1, j &amp;lt;= N Items( list_arg[i] ), j++, 
			Insert Into( NewList, list_arg[i][j] );
		);
	);
	NewList;
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Feb 2017 14:52:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36175#M21259</guid>
      <dc:creator>Phil_Brown</dc:creator>
      <dc:date>2017-02-21T14:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to place List values into the column</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36208#M21281</link>
      <description>&lt;P&gt;Jim,&lt;/P&gt;&lt;P&gt;Wouldn't it just take the items in the first list (which are already lists) into new list (also in the form of one-tem-lists)?&lt;/P&gt;&lt;P&gt;Anyways, I couldn't find a way to fight it when list already formed, but I did it like this:&lt;/P&gt;&lt;P&gt;In the loop that constracts my list of lists, I have something like this:&lt;/P&gt;&lt;PRE&gt;for(t=1, t&amp;lt;=NItems(....)....
......
names[t] = someFunctionThatSpitsSingleNameLists[i][j];
);&lt;/PRE&gt;&lt;P&gt;I do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;names[t] = Item(2,Char(someFunctionThatSpitsSingleNameLists[rowTool][rowcurrentReplacementDate]), "\!"");&lt;/PRE&gt;&lt;P&gt;It just evaluates those single name lists like "{"Jim"}" and then takes only Jim - and puts it in names[t] list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 21:31:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-place-List-values-into-the-column/m-p/36208#M21281</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2017-02-21T21:31:01Z</dc:date>
    </item>
  </channel>
</rss>

