<?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: Restrict For Each() in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Restrict-For-Each/m-p/856127#M102695</link>
    <description>&lt;P&gt;Remove the values from the list before you start going over it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");
collist = dt &amp;lt;&amp;lt; Get Column Names("String");
Remove From(collist, 1, 3);
show(collist);

For Each({colnames, index}, collist,
	rows_to_color = dt &amp;lt;&amp;lt; Get Rows Where((Column(dt, colnames)[] &amp;lt; 100));
	Column(dt, colnames) &amp;lt;&amp;lt; Color Cells("Red", rows_to_color);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Mar 2025 14:11:19 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-03-27T14:11:19Z</dc:date>
    <item>
      <title>Restrict For Each()</title>
      <link>https://community.jmp.com/t5/Discussions/Restrict-For-Each/m-p/856115#M102693</link>
      <description>&lt;P&gt;I'm fairly new to the For Each() function, so bear with me. The script below does what I need, except that I'd like to restrict the columns it acts on.&amp;nbsp; I'd like to act on columns 3 and above only?&amp;nbsp; Straightforward enough with a For() function, not sure how it works here?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each({colnames, index}, dt &amp;lt;&amp;lt; Get Column Names("String"),
 rows_to_color = dt &amp;lt;&amp;lt; Get Rows Where((Column(dt, colnames)[]&amp;lt;100));
 Column(dt, colnames) &amp;lt;&amp;lt; Color Cells("Red", rows_to_color);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Mar 2025 14:01:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Restrict-For-Each/m-p/856115#M102693</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-03-27T14:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict For Each()</title>
      <link>https://community.jmp.com/t5/Discussions/Restrict-For-Each/m-p/856127#M102695</link>
      <description>&lt;P&gt;Remove the values from the list before you start going over it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");
collist = dt &amp;lt;&amp;lt; Get Column Names("String");
Remove From(collist, 1, 3);
show(collist);

For Each({colnames, index}, collist,
	rows_to_color = dt &amp;lt;&amp;lt; Get Rows Where((Column(dt, colnames)[] &amp;lt; 100));
	Column(dt, colnames) &amp;lt;&amp;lt; Color Cells("Red", rows_to_color);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Mar 2025 14:11:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Restrict-For-Each/m-p/856127#M102695</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-03-27T14:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict For Each()</title>
      <link>https://community.jmp.com/t5/Discussions/Restrict-For-Each/m-p/856137#M102696</link>
      <description>&lt;P&gt;You can also do it inside the for each when you define the list, but in my opinion it is better to do it before (easier to read and debug)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

For Each({colname, index}, Remove(dt &amp;lt;&amp;lt; Get Column Names("String"), 1, 3),
	show(colname);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or if you collect list before, you can just loop over specific items&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");
collist = dt &amp;lt;&amp;lt; Get Column Names("String");

For Each({colname, index}, collist[4::N Items(collist)],
	show(colname);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Mar 2025 14:14:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Restrict-For-Each/m-p/856137#M102696</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-03-27T14:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict For Each()</title>
      <link>https://community.jmp.com/t5/Discussions/Restrict-For-Each/m-p/856139#M102698</link>
      <description>&lt;P&gt;Nice!&amp;nbsp; Works well.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Mar 2025 14:14:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Restrict-For-Each/m-p/856139#M102698</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-03-27T14:14:30Z</dc:date>
    </item>
  </channel>
</rss>

