<?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: set value to selected cells in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62600#M33762</link>
    <description>&lt;P&gt;The &lt;STRONG&gt;if&lt;/STRONG&gt; function insures that you only try to set &lt;STRONG&gt;Status&lt;/STRONG&gt; values to 2 if there were any matches.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure about the difference between &lt;STRONG&gt;Column&lt;/STRONG&gt; and &lt;STRONG&gt;As Column&lt;/STRONG&gt;.&amp;nbsp; Generally I just use &lt;STRONG&gt;Column&lt;/STRONG&gt;.&amp;nbsp; If that doesn't work I try &lt;STRONG&gt;As Column&lt;/STRONG&gt;. :)&lt;/img&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jul 2018 13:34:06 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2018-07-12T13:34:06Z</dc:date>
    <item>
      <title>set value to selected cells</title>
      <link>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62545#M33726</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to select certain cells in data table and set value 2 to them, but it doesn't work. Can someone check my script to see what's wrong with it?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;sdt &amp;lt;&amp;lt; selectwhere(
	:Informat( "06/26/2018 16:49:00", "m/d/y h:m:s" ) &amp;lt;= :Time &amp;lt;= :Informat(
		"06/26/2018 16:54:00",
		"m/d/y h:m:s"
	)
);
selRows = sdt &amp;lt;&amp;lt; getselectedRows;
As Column( sdt, "Status" )[selRows] = "2";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jul 2018 20:00:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62545#M33726</guid>
      <dc:creator>Kevin</dc:creator>
      <dc:date>2018-07-11T20:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: set value to selected cells</title>
      <link>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62549#M33729</link>
      <description>&lt;P&gt;I don't have data to run your scritpt on but I changed it around for my data and it worked ok (but I didn't use the informat() function).&amp;nbsp; Then I noticed you have a colon ":" before informat(), and the jsl editor does not show the hover text help for informat with the colon, but it does show it when I remove those colons. Try removing the two colons before the informat() and see if that helps. The colon&lt;STRIKE&gt; is used to define a column variable.&lt;/STRIKE&gt; with syntax ":name" forces &lt;SPAN class="argument"&gt;name&lt;/SPAN&gt; to be evaluated as a data table column.&amp;nbsp; (edited to give a more accurate description, from JMP's website)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW thanks for the tip on the logic structure there. I had no idea I could do a x &amp;lt; y &amp;lt; z in one quick swoop. Usually it's x &amp;lt; y &amp;amp; y &amp;lt; z.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 19:45:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62549#M33729</guid>
      <dc:creator>mikedriscoll</dc:creator>
      <dc:date>2018-07-11T19:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: set value to selected cells</title>
      <link>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62551#M33731</link>
      <description>&lt;P&gt;If you use &lt;STRONG&gt;get rows where&lt;/STRONG&gt; you can make sure that there are rows needing to be changed.&amp;nbsp; As mentioned remove the leading colon from Informat.&amp;nbsp; Change &lt;STRONG&gt;As Column&lt;/STRONG&gt; to &lt;STRONG&gt;Column&lt;/STRONG&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;selrows = sdt &amp;lt;&amp;lt; get rows where(
	Informat( "06/26/2018 16:49:00", "m/d/y h:m:s" ) &amp;lt;= :Time &amp;lt;= :Informat(
		"06/26/2018 16:54:00",
		"m/d/y h:m:s"
	)
);
if (nrows(selrows) &amp;gt; 0,
	Column( sdt, "Status" )[selRows] = "2";
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 20:16:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62551#M33731</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-07-11T20:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: set value to selected cells</title>
      <link>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62553#M33733</link>
      <description>&lt;P&gt;First, remove the colon before Informat().&amp;nbsp; That is telling JMP that Informat is a column name.&amp;nbsp; Start by taking those colons out.&amp;nbsp; You can also simplify your script like so:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;sel rows = sdt &amp;lt;&amp;lt; Get Rows Where(Informat("06/26/2018 16:49:00", "m/d/y h:m:s") &amp;lt;= :Time &amp;lt;= Informat("06/26/2018 16:54:00", "m/d/y h:m:s"));
sdt:Status[selRows]="2";&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You also need to verify that Status is character column.&amp;nbsp; If it's numeric (even if the modeling type is nominal or ordinal), you need to remove the quotes around "2".&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 20:16:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62553#M33733</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-07-11T20:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: set value to selected cells</title>
      <link>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62578#M33750</link>
      <description>&lt;P&gt;What's the difference of having if function here:&lt;/P&gt;&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;if &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;nrows&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;selrows&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;
	&lt;SPAN class="token function"&gt;Column&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; sdt&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"Status"&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;selRows&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;"2"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Also, what's the difference between ascolumn and column?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just try to understand the script&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 00:27:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62578#M33750</guid>
      <dc:creator>Kevin</dc:creator>
      <dc:date>2018-07-12T00:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: set value to selected cells</title>
      <link>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62600#M33762</link>
      <description>&lt;P&gt;The &lt;STRONG&gt;if&lt;/STRONG&gt; function insures that you only try to set &lt;STRONG&gt;Status&lt;/STRONG&gt; values to 2 if there were any matches.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure about the difference between &lt;STRONG&gt;Column&lt;/STRONG&gt; and &lt;STRONG&gt;As Column&lt;/STRONG&gt;.&amp;nbsp; Generally I just use &lt;STRONG&gt;Column&lt;/STRONG&gt;.&amp;nbsp; If that doesn't work I try &lt;STRONG&gt;As Column&lt;/STRONG&gt;. :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 13:34:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62600#M33762</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-07-12T13:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: set value to selected cells</title>
      <link>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62625#M33775</link>
      <description>&lt;P&gt;It works, Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 17:54:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/set-value-to-selected-cells/m-p/62625#M33775</guid>
      <dc:creator>Kevin</dc:creator>
      <dc:date>2018-07-12T17:54:17Z</dc:date>
    </item>
  </channel>
</rss>

