<?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: Get Selected Rows results in error, when using the rows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106820#M39065</link>
    <description>&lt;P&gt;Here is your script, running with some example data that does not have an issue when running JMP 12 or JMP 14.&amp;nbsp; What I would check on your data is that column "bar" is defined as a character column.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=New Table( "Example",
	Add Rows( 3 ),
	New Column( "foo", Character, "Nominal", Set Values( {"a", "", "a"} ) ),
	New Column( "bar", Character, "Nominal", Set Values( {"", "", ""} ) )
);
list = {"a","b"};

For( i = 1, i &amp;lt;= N Items(list), i++,
		item = list[i];
		rows = dt &amp;lt;&amp;lt; Get Rows Where(
			dt:foo == item
		);
		Column(dt, "bar" )[rows] = "foobar";
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 17 Jan 2019 13:15:16 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2019-01-17T13:15:16Z</dc:date>
    <item>
      <title>Get Selected Rows results in error, when using the rows</title>
      <link>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106752#M39061</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;i can´t figure out, why the following results in an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = 1, i &amp;lt;= N Items(list), i++,
		item = list[i];
		rows = dt &amp;lt;&amp;lt; Get Rows Where(
			dt:foo == item
		);
		Column(dt, "bar" )[rows] = "foobar";
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The error is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Cannot set value for the column 'bar' because the row number (-1) is not valid.{941}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone enlighten me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 11:02:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106752#M39061</guid>
      <dc:creator>vkessler</dc:creator>
      <dc:date>2019-01-17T11:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get Selected Rows results in error, when using the rows</title>
      <link>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106820#M39065</link>
      <description>&lt;P&gt;Here is your script, running with some example data that does not have an issue when running JMP 12 or JMP 14.&amp;nbsp; What I would check on your data is that column "bar" is defined as a character column.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=New Table( "Example",
	Add Rows( 3 ),
	New Column( "foo", Character, "Nominal", Set Values( {"a", "", "a"} ) ),
	New Column( "bar", Character, "Nominal", Set Values( {"", "", ""} ) )
);
list = {"a","b"};

For( i = 1, i &amp;lt;= N Items(list), i++,
		item = list[i];
		rows = dt &amp;lt;&amp;lt; Get Rows Where(
			dt:foo == item
		);
		Column(dt, "bar" )[rows] = "foobar";
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:15:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106820#M39065</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-01-17T13:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Get Selected Rows results in error, when using the rows</title>
      <link>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106821#M39066</link>
      <description>&lt;P&gt;Thanks for the quick anwser!&lt;/P&gt;&lt;P&gt;The column is correctly defined and i tried many variants now. Converting the matrix to a list and iterating it etc. --&amp;gt; doesn´t work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that it should work fine. I actually use "&amp;lt;&amp;lt; Get Rows Where" in the same script and it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I now switched to the good old For Each Row loop to do the trick, no problem here.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 13:24:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106821#M39066</guid>
      <dc:creator>vkessler</dc:creator>
      <dc:date>2019-01-17T13:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get Selected Rows results in error, when using the rows</title>
      <link>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106822#M39067</link>
      <description>&lt;P&gt;Is your 'dt' table derived from another table?&amp;nbsp; I&amp;nbsp;think it may be trying to map a row number from one table to another, but it's hard to say for sure without knowing more about the data.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:01:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106822#M39067</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2019-01-17T14:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get Selected Rows results in error, when using the rows</title>
      <link>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106825#M39070</link>
      <description>&lt;P&gt;Your guess is kind of correct. "dt" is actually the original data table. From there i derive other tables and then identify the items i want to select.&lt;/P&gt;&lt;P&gt;Nowing the items, I return to "dt" and perform "&amp;lt;&amp;lt; Get Rows Where (items i want to get)" to get the row numbers. Then i like to set "dt:colum[rows i got] = ...".&lt;/P&gt;&lt;P&gt;Sorry that i neither can´t explain it better or provide the data.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 14:41:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106825#M39070</guid>
      <dc:creator>vkessler</dc:creator>
      <dc:date>2019-01-17T14:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get Selected Rows results in error, when using the rows</title>
      <link>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106928#M39075</link>
      <description>&lt;P&gt;I think this error can come about due to the current data table.&amp;nbsp; The script below will error, but if you comment out the Current Data Table(dt) line, it works as expected.&amp;nbsp; I'm not sure why this works this way - we will look into it further to see if changes are possible to avoid the need to change the Current Data Table().&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");
dt&amp;lt;&amp;lt;Select Where(:sex == "M");
dtm = dt&amp;lt;&amp;lt;Subset(Selected Rows, Link To Original Data Table(1));
// Current Data Table(dt);
rows = dt &amp;lt;&amp;lt; Get Rows Where(:age == 15);
Column(dt, "name")[rows] = "foobar";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Jan 2019 17:55:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-Selected-Rows-results-in-error-when-using-the-rows/m-p/106928#M39075</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2019-01-17T17:55:59Z</dc:date>
    </item>
  </channel>
</rss>

