<?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 Selecting Multiple Rows and Imputing a Value in a Column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Selecting-Multiple-Rows-and-Imputing-a-Value-in-a-Column/m-p/19264#M17568</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data table where I created an empty column, and I wanted to input values into that column based on the rows selected. I have a list of search parameters, and I can select which rows I want based on the list I input, but I just want to put the value of the list into the empty column for all the selected rows. I have most of the script working, but I just can't get the last part which is actually inputting the value into the new column for all the selected rows. Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;group_gender = {"Male","Female"};&lt;/P&gt;&lt;P&gt;results &amp;lt;&amp;lt; New Column("Gender", Character, Nominal);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;For(i = 1, i &amp;lt; nitems(&lt;SPAN style="font-size: 13.3333px;"&gt;group_gender&lt;/SPAN&gt;), i++,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; results &amp;lt;&amp;lt; Select Where(Contains(:Names,&lt;SPAN style="font-size: 13.3333px;"&gt;group_gender&lt;/SPAN&gt;&lt;I&gt;));&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;selRows = results &amp;lt;&amp;lt; getSelectedRows;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Column(results, &lt;SPAN style="font-size: 13.3333px;"&gt;Gender&lt;/SPAN&gt;[selRows]) = eval(&lt;SPAN style="font-size: 13.3333px;"&gt;group_gender&lt;/SPAN&gt;&lt;I&gt;);&lt;/I&gt;&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run this, I get an error "attempting to assign to an object that is not an L-value". Is there a way I can just change a column for all the selected rows to some value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jun 2016 21:27:50 GMT</pubDate>
    <dc:creator>sophiaw</dc:creator>
    <dc:date>2016-06-27T21:27:50Z</dc:date>
    <item>
      <title>Selecting Multiple Rows and Imputing a Value in a Column</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-Multiple-Rows-and-Imputing-a-Value-in-a-Column/m-p/19264#M17568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data table where I created an empty column, and I wanted to input values into that column based on the rows selected. I have a list of search parameters, and I can select which rows I want based on the list I input, but I just want to put the value of the list into the empty column for all the selected rows. I have most of the script working, but I just can't get the last part which is actually inputting the value into the new column for all the selected rows. Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;group_gender = {"Male","Female"};&lt;/P&gt;&lt;P&gt;results &amp;lt;&amp;lt; New Column("Gender", Character, Nominal);&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;For(i = 1, i &amp;lt; nitems(&lt;SPAN style="font-size: 13.3333px;"&gt;group_gender&lt;/SPAN&gt;), i++,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; results &amp;lt;&amp;lt; Select Where(Contains(:Names,&lt;SPAN style="font-size: 13.3333px;"&gt;group_gender&lt;/SPAN&gt;&lt;I&gt;));&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;selRows = results &amp;lt;&amp;lt; getSelectedRows;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Column(results, &lt;SPAN style="font-size: 13.3333px;"&gt;Gender&lt;/SPAN&gt;[selRows]) = eval(&lt;SPAN style="font-size: 13.3333px;"&gt;group_gender&lt;/SPAN&gt;&lt;I&gt;);&lt;/I&gt;&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run this, I get an error "attempting to assign to an object that is not an L-value". Is there a way I can just change a column for all the selected rows to some value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2016 21:27:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-Multiple-Rows-and-Imputing-a-Value-in-a-Column/m-p/19264#M17568</guid>
      <dc:creator>sophiaw</dc:creator>
      <dc:date>2016-06-27T21:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Multiple Rows and Imputing a Value in a Column</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-Multiple-Rows-and-Imputing-a-Value-in-a-Column/m-p/19265#M17569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use AsColumn(dt,col) for assignment and place the index outside the parentheses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&lt;SPAN style="color: #032ce4;"&gt;For&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; i &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="color: #009193;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; i &lt;SPAN style="color: #011993;"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN style="color: #032ce4;"&gt;NItems&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; group_gender &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; i&lt;SPAN style="color: #011993;"&gt;++,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; results &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;Select Where&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #032ce4;"&gt;Contains&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;:&lt;/SPAN&gt;Names&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; group_gender&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; selRows &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; results &lt;SPAN style="color: #011993;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="color: #011993;"&gt;&lt;STRONG&gt;getSelectedRows&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #032ce4;"&gt;AsColumn&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; results&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt; &lt;SPAN style="color: #942193;"&gt;"Gender"&lt;/SPAN&gt; &lt;STRONG&gt;)[&lt;/STRONG&gt;selRows&lt;STRONG&gt;]&lt;/STRONG&gt; &lt;SPAN style="color: #011993;"&gt;=&lt;/SPAN&gt; group_gender&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// this works to:&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier; color: #008f00;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;// results:Gender[selRows] = group_gender&lt;I&gt;;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0px; font-size: 14px; line-height: normal; font-family: Courier;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2016 22:44:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-Multiple-Rows-and-Imputing-a-Value-in-a-Column/m-p/19265#M17569</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2016-06-27T22:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting Multiple Rows and Imputing a Value in a Column</title>
      <link>https://community.jmp.com/t5/Discussions/Selecting-Multiple-Rows-and-Imputing-a-Value-in-a-Column/m-p/19266#M17570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you MS! I knew that last line had to be wrong, and that fixed it! &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" src="https://community.jmp.com/7.0.4.3b79b96/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2016 23:39:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Selecting-Multiple-Rows-and-Imputing-a-Value-in-a-Column/m-p/19266#M17570</guid>
      <dc:creator>sophiaw</dc:creator>
      <dc:date>2016-06-27T23:39:31Z</dc:date>
    </item>
  </channel>
</rss>

