<?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: Variable column group name for 'Group Columns()' in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53229#M30132</link>
    <description>&lt;P&gt;Here is how to get to the documentation on the escape characters.&amp;nbsp; Go to&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Books==&amp;gt;Scripting Guide&lt;/P&gt;
&lt;P&gt;and then do a page search for&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;\!&lt;/P&gt;
&lt;P&gt;It will take you directly to the table of escape characters&lt;/P&gt;</description>
    <pubDate>Thu, 15 Mar 2018 19:22:55 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-03-15T19:22:55Z</dc:date>
    <item>
      <title>Variable column group name for 'Group Columns()'</title>
      <link>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53088#M30043</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to select columns based on a list of strings, and dump the columns into a group also based on the list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code I'm using:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();&lt;BR /&gt;// phase names by which we want to group
groupnames = {"Centering", "Dwell", "Capture", "Locking"};

// all column names in the table
allcols = dt &amp;lt;&amp;lt; Get Column Names();

For( i = 1, i &amp;lt;= N Items( groupnames ), i++,
	curgroup = {};
	dt &amp;lt;&amp;lt; Clear Column Selection;
	// get all cols with the phase name
	For( j = 1, j &amp;lt;= N Items( allcols ), j++,
		If( Contains( allcols[j], groupnames[i] ),
			As Column( allcols[j] ) &amp;lt;&amp;lt; Set Selected( 1 );
			//Insert Into(curgroup, allcols[j]);
		);
	);
	// make a new group from these columns
	//dt &amp;lt;&amp;lt; Group Columns(char(groupnames[i]), curgroup);
	dt &amp;lt;&amp;lt; Group Columns( groupnames[i] );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I get the error "JMP cannot determine the columns to be grouped from the given script."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I change the last line to something like dt &amp;lt;&amp;lt; Group Columns ( "fixed string") it will work (but they'll all be in the same group).&amp;nbsp; I'm not sure what I'm doing wrong.&amp;nbsp; groupnames[i] should be a string (right?), which is the expected input for Group Columns().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kristo&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 20:31:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53088#M30043</guid>
      <dc:creator>klkriech</dc:creator>
      <dc:date>2018-03-13T20:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column group name for 'Group Columns()'</title>
      <link>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53101#M30056</link>
      <description>&lt;P&gt;Sometimes, JMP is weird about evaluating variables that should resolve to the expected argument type.&amp;nbsp; I generally try not to do this, but you can usually get around these issues with a Eval-Parse-Eval Insert sequence.&amp;nbsp; This always feels like a bit of a hack, but it's like duct tape with JSL.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();// phase names by which we want to group
groupnames = {"Centering", "Dwell", "Capture", "Locking"};

// all column names in the table
allcols = dt &amp;lt;&amp;lt; Get Column Names();

For( i = 1, i &amp;lt;= N Items( groupnames ), i++,
	curgroup = {};
	
	// get all cols with the phase name
	For( j = 1, j &amp;lt;= N Items( allcols ), j++,
		If( Contains( allcols[j], groupnames[i] ) &amp;gt; 0,
			Insert Into(curgroup, allcols[j]);
		);
	);
	
	// make a new group from these columns
	Eval(Parse(Eval Insert("\[dt &amp;lt;&amp;lt; Group Columns( "^groupnames[i]^", curgroup )]\")));
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 13 Mar 2018 23:26:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53101#M30056</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-03-13T23:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column group name for 'Group Columns()'</title>
      <link>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53213#M30119</link>
      <description>&lt;P&gt;Thanks, that did it!&amp;nbsp; Any pointer to documentation on the what the different escape sequences are for?&amp;nbsp; The "help" for Parse() is not so useful.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 17:04:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53213#M30119</guid>
      <dc:creator>klkriech</dc:creator>
      <dc:date>2018-03-15T17:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column group name for 'Group Columns()'</title>
      <link>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53214#M30120</link>
      <description>&lt;P&gt;Eval Insert() evaluates variables within a string. The variables in the string are wrapped in “^” characters. Parse() turns a string into an expression. Eval() evaluates the expression.&lt;BR /&gt;&lt;BR /&gt;So basically you build the expression as a string with the variable values resolved within the string, you parse the string into an expression, and evaluate the expression.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 19:35:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53214#M30120</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-03-15T19:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column group name for 'Group Columns()'</title>
      <link>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53229#M30132</link>
      <description>&lt;P&gt;Here is how to get to the documentation on the escape characters.&amp;nbsp; Go to&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Books==&amp;gt;Scripting Guide&lt;/P&gt;
&lt;P&gt;and then do a page search for&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;\!&lt;/P&gt;
&lt;P&gt;It will take you directly to the table of escape characters&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 19:22:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53229#M30132</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-15T19:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column group name for 'Group Columns()'</title>
      <link>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53230#M30133</link>
      <description>&lt;P&gt;Thanks again.&amp;nbsp; I was just looking in the html documentation, not the books.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 19:29:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Variable-column-group-name-for-Group-Columns/m-p/53230#M30133</guid>
      <dc:creator>klkriech</dc:creator>
      <dc:date>2018-03-15T19:29:01Z</dc:date>
    </item>
  </channel>
</rss>

