<?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: JSL how to rename column name by expression in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325640#M57497</link>
    <description>Hi Nelson,&lt;BR /&gt;&lt;BR /&gt;Statistic column name will work if you didn't use subgroup. In my case, i need to use subgroup. % of Total will still attached to the subgroup</description>
    <pubDate>Fri, 23 Oct 2020 05:07:41 GMT</pubDate>
    <dc:creator>OneNorthJMP</dc:creator>
    <dc:date>2020-10-23T05:07:41Z</dc:date>
    <item>
      <title>JSL how to rename column name by expression</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325615#M57491</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a list of of columns name that generated by Summary statistic. I want to remove all the prefix and sufix that only keep the part that i want. how do i do this in JSL?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Columns&lt;/P&gt;&lt;P&gt;% of Total(UP9019-01) =&amp;gt;&amp;nbsp;UP9019-01&lt;/P&gt;&lt;P&gt;% of Total(UP9019-02)&amp;nbsp;=&amp;gt;&amp;nbsp;UP9019-02&lt;/P&gt;&lt;P&gt;% of Total(UP9019-03)&amp;nbsp;=&amp;gt;&amp;nbsp;UP9019-03&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:41:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325615#M57491</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2023-06-09T23:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: JSL how to rename column name by expression</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325636#M57494</link>
      <description>&lt;P&gt;The first way I would handle this, is to have the Summary Platform name the output column as the same as the input column name.&amp;nbsp; This is done by specifying&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;statistics column name format( "column" )&lt;/P&gt;
&lt;P&gt;This is selectable from the Summary Platform Input Dialog Box&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can not do this, then all that has to be done is to reset the column name using this JSL&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:Name("% of Total(UP9010-01)") &amp;lt;&amp;lt; set name( "UP9019-01: );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If this needs to be automated and not hard coded, and this column is the first column in the data table, it could be handled with this JSL&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;column(1) &amp;lt;&amp;lt; set name(word(2,column(1)&amp;lt;&amp;lt;get name,"()"))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Oct 2020 03:27:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325636#M57494</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-10-23T03:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: JSL how to rename column name by expression</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325637#M57495</link>
      <description>&lt;P&gt;Hi Nelson,&lt;BR /&gt;&lt;BR /&gt;Thanks for the tips. 1st option that specifying statics column name format ("column") does not work. It still carry the % of Total in the table.&lt;BR /&gt;&lt;BR /&gt;JSL option that you suggest work perfectly!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ColList = dt_source &amp;lt;&amp;lt; get column names( string );
//% of Total(UP9019-01)
For( i = 4, i &amp;lt;= N Items( ColList ), i++,
    Column( i ) &amp;lt;&amp;lt; set name( Word( 2, Column( i ) &amp;lt;&amp;lt; get name, "()" ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Oct 2020 10:21:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325637#M57495</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2020-10-23T10:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: JSL how to rename column name by expression</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325639#M57496</link>
      <description>&lt;P&gt;Here is a simple example using the "statistics column name format( "column" )" option, showing the % of Total columns named their original column name&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stat.PNG" style="width: 437px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/27609iB17C774F7511EE65/image-size/large?v=v2&amp;amp;px=999" role="button" title="stat.PNG" alt="stat.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");

Data Table( "big class" ) &amp;lt;&amp;lt; Summary(
	Group( :age ),
	Name( "% of Total" )(:height),
	Name( "% of Total" )(:weight),
	Freq( "None" ),
	Weight( "None" ),
	statistics column name format( "column" ),
	Link to original data table( 0 )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Oct 2020 03:57:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325639#M57496</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-10-23T03:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: JSL how to rename column name by expression</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325640#M57497</link>
      <description>Hi Nelson,&lt;BR /&gt;&lt;BR /&gt;Statistic column name will work if you didn't use subgroup. In my case, i need to use subgroup. % of Total will still attached to the subgroup</description>
      <pubDate>Fri, 23 Oct 2020 05:07:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-how-to-rename-column-name-by-expression/m-p/325640#M57497</guid>
      <dc:creator>OneNorthJMP</dc:creator>
      <dc:date>2020-10-23T05:07:41Z</dc:date>
    </item>
  </channel>
</rss>

