<?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: Rename subgroup column names from summary table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Rename-subgroup-column-names-from-summary-table/m-p/703881#M88802</link>
    <description>&lt;P&gt;Here is a modification to your script.&amp;nbsp; The first modification is gives a name to the summary table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Output Table( "My Summary" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second modification loops through all columns in the new table and changes any column who's name starts with "rcr%," and changes the name.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Create a list of all of the column
colNames = Data Table( "My Summary" ) &amp;lt;&amp;lt; get column names( string );

// Loop through all of the names, and when "rcr%," is found in the 
// start of the column name, change the name to the column name 
// starting from the 7th character in the name
For Each( {col}, colNames,
	If( Contains( col, "rcr%," ) == 1,
		Column( col ) &amp;lt;&amp;lt; set name( Substr( col, 7 ) )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is the complete script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );
Data Table( "DVIRCR_SumTable" ) &amp;lt;&amp;lt; Summary(
	Group( :prodgroup3, :subapp ),
	Max( :rcr% ),
	Subgroup( :date_ ),
	Freq( "None" ),
	Weight( "None" ),
	statistics column name format( "column" ),
	Link to original data table( 0 ),
	Output Table( "My Summary" )
);
 
//rename N Rows column to Lot Count
:Name( "N Rows" ) &amp;lt;&amp;lt; Set Name( "Lot Count" );

// Create a list of all of the column
colNames = Data Table( "My Summary" ) &amp;lt;&amp;lt; get column names( string );

// Loop through all of the names, and when "rcr%," is found in the 
// start of the column name, change the name to the column name 
// starting from the 7th character in the name
For Each( {col}, colNames,
	If( Contains( col, "rcr%," ) == 1,
		Column( col ) &amp;lt;&amp;lt; set name( Substr( col, 7 ) )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, please enter your JSL into discussions using the&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1701262046257.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59136iD308932EB1EE23F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_1-1701262046257.png" alt="txnelson_1-1701262046257.png" /&gt;&lt;/span&gt;&amp;nbsp;icon which displays the JSL in a format easier for the Community Members to read and understand the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2023 12:48:07 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-11-29T12:48:07Z</dc:date>
    <item>
      <title>Rename subgroup column names from summary table</title>
      <link>https://community.jmp.com/t5/Discussions/Rename-subgroup-column-names-from-summary-table/m-p/703805#M88797</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need help with my script. I have a script that creates a summary table from raw data table as below;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "DVIRCR_SumTable" ) &amp;lt;&amp;lt; Summary(
	Group( :prodgroup3, :subapp ),
	Max( :rcr% ),
	Subgroup( :date_ ),
	Freq( "None" ),
	Weight( "None" ),
	statistics column name format( "column" ),
	Link to original data table( 0 )
);
 
//rename N Rows column to Lot Count
:Name( "N Rows" ) &amp;lt;&amp;lt; Set Name( "Lot Count" );
******&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now i need to rename the subgroup column automatically. The date will change everyday.&lt;/P&gt;
&lt;P&gt;i want to change from current format -- rcr%(:date_) to format -- :date_&lt;/P&gt;
&lt;P&gt;Ultimately i don't want any rcr% word in front of the date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Leyahans_0-1701248037186.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59124i5AE79FB71E2C6517/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Leyahans_0-1701248037186.png" alt="Leyahans_0-1701248037186.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 12:42:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rename-subgroup-column-names-from-summary-table/m-p/703805#M88797</guid>
      <dc:creator>Leyahans</dc:creator>
      <dc:date>2023-11-29T12:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rename subgroup column names from summary table</title>
      <link>https://community.jmp.com/t5/Discussions/Rename-subgroup-column-names-from-summary-table/m-p/703881#M88802</link>
      <description>&lt;P&gt;Here is a modification to your script.&amp;nbsp; The first modification is gives a name to the summary table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Output Table( "My Summary" )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second modification loops through all columns in the new table and changes any column who's name starts with "rcr%," and changes the name.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Create a list of all of the column
colNames = Data Table( "My Summary" ) &amp;lt;&amp;lt; get column names( string );

// Loop through all of the names, and when "rcr%," is found in the 
// start of the column name, change the name to the column name 
// starting from the 7th character in the name
For Each( {col}, colNames,
	If( Contains( col, "rcr%," ) == 1,
		Column( col ) &amp;lt;&amp;lt; set name( Substr( col, 7 ) )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here is the complete script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );
Data Table( "DVIRCR_SumTable" ) &amp;lt;&amp;lt; Summary(
	Group( :prodgroup3, :subapp ),
	Max( :rcr% ),
	Subgroup( :date_ ),
	Freq( "None" ),
	Weight( "None" ),
	statistics column name format( "column" ),
	Link to original data table( 0 ),
	Output Table( "My Summary" )
);
 
//rename N Rows column to Lot Count
:Name( "N Rows" ) &amp;lt;&amp;lt; Set Name( "Lot Count" );

// Create a list of all of the column
colNames = Data Table( "My Summary" ) &amp;lt;&amp;lt; get column names( string );

// Loop through all of the names, and when "rcr%," is found in the 
// start of the column name, change the name to the column name 
// starting from the 7th character in the name
For Each( {col}, colNames,
	If( Contains( col, "rcr%," ) == 1,
		Column( col ) &amp;lt;&amp;lt; set name( Substr( col, 7 ) )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, please enter your JSL into discussions using the&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1701262046257.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59136iD308932EB1EE23F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_1-1701262046257.png" alt="txnelson_1-1701262046257.png" /&gt;&lt;/span&gt;&amp;nbsp;icon which displays the JSL in a format easier for the Community Members to read and understand the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 12:48:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rename-subgroup-column-names-from-summary-table/m-p/703881#M88802</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-29T12:48:07Z</dc:date>
    </item>
  </channel>
</rss>

