<?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: Settings value of column based on selected column in a summary table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Settings-value-of-column-based-on-selected-column-in-a-summary/m-p/85757#M38290</link>
    <description>Thanks, that does it :)&lt;/img&gt;</description>
    <pubDate>Thu, 13 Dec 2018 13:52:10 GMT</pubDate>
    <dc:creator>AWMN</dc:creator>
    <dc:date>2018-12-13T13:52:10Z</dc:date>
    <item>
      <title>Settings value of column based on selected column in a summary table</title>
      <link>https://community.jmp.com/t5/Discussions/Settings-value-of-column-based-on-selected-column-in-a-summary/m-p/85747#M38282</link>
      <description>&lt;P&gt;Hi experts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a linked summary table, in which i select rows, based on a criteria.&lt;/P&gt;&lt;P&gt;In my main table, I now need to set a specific value in a column, for the selected rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made a basic table with the following:&lt;/P&gt;&lt;P&gt;Sample&amp;nbsp; &amp;nbsp;error&lt;/P&gt;&lt;P&gt;s1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;s1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;s1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;s2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;s2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;s2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some very simplified code as an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt = current data table();&lt;/P&gt;&lt;P&gt;dt_sum = dt &amp;lt;&amp;lt; Summary(&lt;BR /&gt;Group( :sample),&lt;BR /&gt;Freq( "None" ),&lt;BR /&gt;Weight( "None" )&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;dt_sum &amp;lt;&amp;lt; select where (:sample == "s1");&lt;BR /&gt;r = dt &amp;lt;&amp;lt; get selected rows;&lt;/P&gt;&lt;P&gt;close(dt_sum, nosave);&lt;/P&gt;&lt;P&gt;column(dt, "error")[r] = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code runs, if the dt_sum is closed. In my code however, this is not possible, as it is needed later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the following error, if dt_sum is not closed&lt;/P&gt;&lt;P&gt;"Cannot set value for the column 'error' because the row number (-1) is not valid.{1}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Further more, the error value for line 1 and 4 is changed to 1, but not the rest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can any of you explain me why this is not working, or help me with a possible workaround?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance, Anders&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 11:31:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Settings-value-of-column-based-on-selected-column-in-a-summary/m-p/85747#M38282</guid>
      <dc:creator>AWMN</dc:creator>
      <dc:date>2018-12-13T11:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Settings value of column based on selected column in a summary table</title>
      <link>https://community.jmp.com/t5/Discussions/Settings-value-of-column-based-on-selected-column-in-a-summary/m-p/85752#M38286</link>
      <description>&lt;P&gt;1.&amp;nbsp; I think you should submit the issue to JMP Support.&amp;nbsp; It appears that eventhough you are directly pointing to the "dt" data table, it is still looking to the "dt_sum" data table and updating there.&lt;/P&gt;
&lt;P&gt;2. Here is a work around that allows the code to work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();
dt_sum = dt &amp;lt;&amp;lt; Summary(
Group( :sample),
Freq( "None" ),
Weight( "None" )
);
dt_sum &amp;lt;&amp;lt; select where (:sample == "s1");
r = dt &amp;lt;&amp;lt; get selected rows;
//close(dt_sum, nosave);
current data table(dt);
column(dt, "error")[r] = 1;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Dec 2018 12:33:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Settings-value-of-column-based-on-selected-column-in-a-summary/m-p/85752#M38286</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-12-13T12:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Settings value of column based on selected column in a summary table</title>
      <link>https://community.jmp.com/t5/Discussions/Settings-value-of-column-based-on-selected-column-in-a-summary/m-p/85757#M38290</link>
      <description>Thanks, that does it :)&lt;/img&gt;</description>
      <pubDate>Thu, 13 Dec 2018 13:52:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Settings-value-of-column-based-on-selected-column-in-a-summary/m-p/85757#M38290</guid>
      <dc:creator>AWMN</dc:creator>
      <dc:date>2018-12-13T13:52:10Z</dc:date>
    </item>
  </channel>
</rss>

