<?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: How to set format for a column group (i.e. not individually)? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632232#M83067</link>
    <description>&lt;P&gt;The following does the job for me. Thanks.&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 ); &lt;BR /&gt;dt = Open ("myDataTable.jmp"); /*load data table*/&lt;BR /&gt;ListofNumericCols = dt &amp;lt;&amp;lt; get column names(numeric, Continuous); //get list of columns to group
NumericCols = dt &amp;lt;&amp;lt; Group Columns ("NumericCols",ListofNumericCols);  // group columns
dt&amp;lt;&amp;lt; Select Columns (dt&amp;lt;&amp;lt;Get Column Group(NumericCols)); // select grouped columns
selecedColNames = dt &amp;lt;&amp;lt; Get Selected Columns; // get column names in a list
\\ set desired format for the column group&lt;BR /&gt;Local( {old dt = Current Data Table()},
	Current Data Table( Data Table( "myDataTable" ) );
	For Each( {col, index},
		selecedColNames,
		col &amp;lt;&amp;lt; Format( "Fixed Dec", 12, 2 )
	);
	Current Data Table( old dt );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 May 2023 12:39:45 GMT</pubDate>
    <dc:creator>Neo</dc:creator>
    <dc:date>2023-05-16T12:39:45Z</dc:date>
    <item>
      <title>How to set format for a column group (i.e. not individually)?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632195#M83062</link>
      <description>&lt;P&gt;I have a column group for which I want to change the format. I know how to do this for a given column as below&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here (1);
dt = Open ("myTable.jmp"); 
//Show( dt:myCol &amp;lt;&amp;lt; get format );
dt:myCol&amp;lt;&amp;lt; Format( "Fixed Dec", 10, 2 );
//Show( dt:myCol&amp;lt;&amp;lt; get format );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How to do this for column group in JSL?&lt;/P&gt;&lt;P&gt;(I guess I need a JSL variant of this &lt;A href="https://community.jmp.com/t5/Discussions/how-to-multiple-column-format-at-once/td-p/238726" target="_self"&gt;https://community.jmp.com/t5/Discussions/how-to-multiple-column-format-at-once/td-p/238726&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:10:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632195#M83062</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-06-09T16:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to set format for a column group (i.e. not individually)?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632218#M83064</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/28235"&gt;@Neo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When selecting multiple columns, you can right-click on them and select "Standardize Attributes" (&lt;A href="https://www.jmp.com/support/help/en/17.1/?os=win&amp;amp;source=application#page/jmp/standardize-attributes-and-properties-across-columns.shtml#" target="_blank" rel="noopener"&gt;Standardize Attributes and Properties Across Columns (jmp.com)&lt;/A&gt;) :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Victor_G_0-1684238550629.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/52820iBA3322C265E78F48/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Victor_G_0-1684238550629.png" alt="Victor_G_0-1684238550629.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Looking at the script log, you can then extract the code for this attributes standardization. Example here is :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Standardize column attributes
Local( {old dt = Current Data Table()},
	Current Data Table( Data Table( "Test" ) );
	For Each( {col, index}, {:Column 1, :Column 2, :Column 3},
		col &amp;lt;&amp;lt; Data Type( Numeric, Format( "Fixed Dec", 12, 2 ) ) &amp;lt;&amp;lt; Set Modeling Type( "Continuous" )
	);
	Current Data Table( old dt );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this answer will help you,&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 12:12:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632218#M83064</guid>
      <dc:creator>Victor_G</dc:creator>
      <dc:date>2023-05-16T12:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to set format for a column group (i.e. not individually)?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632229#M83065</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11568"&gt;@Victor_G&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks. I am trying to avoid&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;{:Column 1, :Column 2, :Column 3}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;as these are expected to change on a case by case basis. I can select the relevant (numeric) columns as&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ListofNumericCols = dt &amp;lt;&amp;lt; get column names(numeric, Continuous);
NumericCols = dt &amp;lt;&amp;lt; Group Columns ("NumericCols",ListofNumericCols); 
dt&amp;lt;&amp;lt; Select Columns (dt&amp;lt;&amp;lt;Get Column Group(NumericCols));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and then I want to change the format of the group "NumericCols" at once. How to/Can we do this in JSL?&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 12:22:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632229#M83065</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-05-16T12:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to set format for a column group (i.e. not individually)?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632232#M83067</link>
      <description>&lt;P&gt;The following does the job for me. Thanks.&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 ); &lt;BR /&gt;dt = Open ("myDataTable.jmp"); /*load data table*/&lt;BR /&gt;ListofNumericCols = dt &amp;lt;&amp;lt; get column names(numeric, Continuous); //get list of columns to group
NumericCols = dt &amp;lt;&amp;lt; Group Columns ("NumericCols",ListofNumericCols);  // group columns
dt&amp;lt;&amp;lt; Select Columns (dt&amp;lt;&amp;lt;Get Column Group(NumericCols)); // select grouped columns
selecedColNames = dt &amp;lt;&amp;lt; Get Selected Columns; // get column names in a list
\\ set desired format for the column group&lt;BR /&gt;Local( {old dt = Current Data Table()},
	Current Data Table( Data Table( "myDataTable" ) );
	For Each( {col, index},
		selecedColNames,
		col &amp;lt;&amp;lt; Format( "Fixed Dec", 12, 2 )
	);
	Current Data Table( old dt );
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 May 2023 12:39:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632232#M83067</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-05-16T12:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to set format for a column group (i.e. not individually)?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632295#M83072</link>
      <description>&lt;P&gt;You do not need to first select columns in a group and then get their references.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// example
dt = Open( "$SAMPLE_DATA/Cities.jmp" );

// create column groups
dt &amp;lt;&amp;lt; group columns( "xy", {:X, :y} );
dt &amp;lt;&amp;lt; group columns( "pollutants", :Ozone :: :Lead );

// get col references to each member in group
col = dt &amp;lt;&amp;lt; get column group( "xy" );

// iterate over list and make change to attribute or proptery
For( c = 1, c &amp;lt;= N Items( col ), c++,
	col[c] &amp;lt;&amp;lt; Format( "Fixed Dec", 6, 2 );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 May 2023 14:33:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-set-format-for-a-column-group-i-e-not-individually/m-p/632295#M83072</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2023-05-16T14:33:20Z</dc:date>
    </item>
  </channel>
</rss>

