<?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 Try statement with Group Columns in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Try-statement-with-Group-Columns/m-p/931952#M108849</link>
    <description>&lt;P&gt;I have a list of columns I want to group but the script fails if any of the columns are absent.&amp;nbsp; A try statement does not seem to fix the problem.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

Try( dt &amp;lt;&amp;lt;  Group Columns ("TM", {:Param_1, :&lt;CODE class="language-jsl"&gt;Param_2&lt;/CODE&gt;, :&lt;CODE class="language-jsl"&gt;Param_3&lt;/CODE&gt;}));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 20 Feb 2026 21:21:16 GMT</pubDate>
    <dc:creator>SpannerHead</dc:creator>
    <dc:date>2026-02-20T21:21:16Z</dc:date>
    <item>
      <title>Try statement with Group Columns</title>
      <link>https://community.jmp.com/t5/Discussions/Try-statement-with-Group-Columns/m-p/931952#M108849</link>
      <description>&lt;P&gt;I have a list of columns I want to group but the script fails if any of the columns are absent.&amp;nbsp; A try statement does not seem to fix the problem.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

Try( dt &amp;lt;&amp;lt;  Group Columns ("TM", {:Param_1, :&lt;CODE class="language-jsl"&gt;Param_2&lt;/CODE&gt;, :&lt;CODE class="language-jsl"&gt;Param_3&lt;/CODE&gt;}));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Feb 2026 21:21:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Try-statement-with-Group-Columns/m-p/931952#M108849</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2026-02-20T21:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Try statement with Group Columns</title>
      <link>https://community.jmp.com/t5/Discussions/Try-statement-with-Group-Columns/m-p/931962#M108850</link>
      <description>&lt;P&gt;If you want to group all columns present in that list (even if, say, :Param_2 is missing), you could try something like this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
cols = {:a, :b, :c, :d, :e};
dt &amp;lt;&amp;lt; Group Columns( "Some Columns", Filter Each( {v, i}, cols, dt &amp;lt;&amp;lt; Has Column( Char( Name Expr( v ) ) ) ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Feb 2026 21:35:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Try-statement-with-Group-Columns/m-p/931962#M108850</guid>
      <dc:creator>mmarchandFSLR</dc:creator>
      <dc:date>2026-02-20T21:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Try statement with Group Columns</title>
      <link>https://community.jmp.com/t5/Discussions/Try-statement-with-Group-Columns/m-p/931963#M108851</link>
      <description>&lt;P&gt;Had to tweak this a bit to identify dt.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
cols = {:a, :b, :c, :d, :e};
dt &amp;lt;&amp;lt; Group Columns( "Some Columns", Filter Each( {v, i}, cols, dt &amp;lt;&amp;lt; Has Column( Char( Name Expr( v ) ) ) ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 Feb 2026 21:47:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Try-statement-with-Group-Columns/m-p/931963#M108851</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2026-02-20T21:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Try statement with Group Columns</title>
      <link>https://community.jmp.com/t5/Discussions/Try-statement-with-Group-Columns/m-p/931964#M108852</link>
      <description>&lt;P&gt;My suggestion would be to avoid :col and use strings. With JMP19 you can use Set Intersection&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

g = {"age", "sex", "height", "test", "test2"};

mycols = Set Intersection(dt &amp;lt;&amp;lt; Get Column Names("String"), g);

dt &amp;lt;&amp;lt; Group Columns("MyGroup", mycols);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In earlier versions Associative Arrays (or Filter Each) can replace Set Intersection&lt;/P&gt;</description>
      <pubDate>Fri, 20 Feb 2026 22:13:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Try-statement-with-Group-Columns/m-p/931964#M108852</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-02-20T22:13:42Z</dc:date>
    </item>
  </channel>
</rss>

