<?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: Dynamically passing a set of columns to a table summary function in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Dynamically-passing-a-set-of-columns-to-a-table-summary-function/m-p/895218#M105590</link>
    <description>&lt;P&gt;I believe this gives you what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );
dt = Data Table( "plate_data_wide_for_dynamic_summary Anonymized" );
nCols = N Col( dt );

//empty list of colnames, populate with col names from 14 to end of table
colnames = dt &amp;lt;&amp;lt; get column names( string ); //num cols

staticNames = {"X__1", "X__3", "X__10"};

For Each( {sName}, staticNames, Try( Remove From( colnames, Contains( colnames, sName ), 1 ) ) );

//create summary expression with dynamic column placeholder
Eval(
	Eval Expr(
		Data Table( "plate_data_wide_for_dynamic_summary Anonymized" ) &amp;lt;&amp;lt;
		Summary(
			Group( Expr( staticNames ) ),
			Median( Expr( colnames ) ),
			Freq( "None" ),
			Weight( "None" ),
			output table name( "Summarized by PC plate_well wide" )
		)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1755574428987.png" style="width: 750px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/80629i91E99CE5595D938E/image-dimensions/750x344?v=v2" width="750" height="344" role="button" title="txnelson_0-1755574428987.png" alt="txnelson_0-1755574428987.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Aug 2025 03:34:11 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2025-08-19T03:34:11Z</dc:date>
    <item>
      <title>Dynamically passing a set of columns to a table summary function</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamically-passing-a-set-of-columns-to-a-table-summary-function/m-p/895150#M105584</link>
      <description>&lt;P&gt;I have a workflow that generates a table (sample attached), but the number of columns and name of those columns from 14 on will vary depending on the dataset the end user is looking at.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first part of the script works no problem - generating a list of the column names. What I'm struggling with and is beyond anything I've done in JSL so far is passing that list back into a table summary function. Full transparency, I did try to troubleshoot this with MS Copilot (AI Agent pointed to JMP documentation) with no success.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//num cols
dt = Data Table( "plate_data_wide_for_dynamic_summary Anonymized" );
nCols = N Col( dt );

//empty list of colnames, populate with col names from 14 to end of table
colnames = {};
For( i = 14, i &amp;lt;= nCols, i++,
	Insert Into( colnames, Column( dt, i ) &amp;lt;&amp;lt; Get Name )
);

//create summary expression with dynamic column placeholder
summaryExpr = Expr(
	Data Table( "plate_data_wide_for_dynamic_summary Anonymized" ) &amp;lt;&amp;lt; Summary(
		Group(
			:X__1, :X__3, :X__10
		),
		__DYNAMIC_COLUMNS__,
		Freq( "None" ),
		Weight( "None" ),
		output table name( "Summarized by PC plate_well wide" )
	)
);

//create list of summary statistics and columns to pass to summary function
dynamicCols = {};
For( i = 1, i &amp;lt;= N Items( colnames ), i++,
	Insert Into( dynamicCols, Eval Expr( Median( As Column( dt, colnames[i] ) ) ) )
);

//pass dynamicCols list to summary expression and evaluate
Insert Into( summaryExpr[1][2], dynamicCols );
Eval( summaryExpr );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Aug 2025 20:30:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamically-passing-a-set-of-columns-to-a-table-summary-function/m-p/895150#M105584</guid>
      <dc:creator>Stefan_Moser</dc:creator>
      <dc:date>2025-08-18T20:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically passing a set of columns to a table summary function</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamically-passing-a-set-of-columns-to-a-table-summary-function/m-p/895218#M105590</link>
      <description>&lt;P&gt;I believe this gives you what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );
dt = Data Table( "plate_data_wide_for_dynamic_summary Anonymized" );
nCols = N Col( dt );

//empty list of colnames, populate with col names from 14 to end of table
colnames = dt &amp;lt;&amp;lt; get column names( string ); //num cols

staticNames = {"X__1", "X__3", "X__10"};

For Each( {sName}, staticNames, Try( Remove From( colnames, Contains( colnames, sName ), 1 ) ) );

//create summary expression with dynamic column placeholder
Eval(
	Eval Expr(
		Data Table( "plate_data_wide_for_dynamic_summary Anonymized" ) &amp;lt;&amp;lt;
		Summary(
			Group( Expr( staticNames ) ),
			Median( Expr( colnames ) ),
			Freq( "None" ),
			Weight( "None" ),
			output table name( "Summarized by PC plate_well wide" )
		)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1755574428987.png" style="width: 750px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/80629i91E99CE5595D938E/image-dimensions/750x344?v=v2" width="750" height="344" role="button" title="txnelson_0-1755574428987.png" alt="txnelson_0-1755574428987.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 03:34:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamically-passing-a-set-of-columns-to-a-table-summary-function/m-p/895218#M105590</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-08-19T03:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically passing a set of columns to a table summary function</title>
      <link>https://community.jmp.com/t5/Discussions/Dynamically-passing-a-set-of-columns-to-a-table-summary-function/m-p/895384#M105602</link>
      <description>&lt;P&gt;Awesome Jim thank you, I made a slight modification to pass column names 14 to end vs. any columns that weren't used for grouping. Here's the final version:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );
dt = Data Table( "plate_data_wide_for_dynamic_summary Anonymized" );
nCols = N Col( dt );

//empty list of colnames, populate with col names from 14 to end of table
colnames = {};
For( i = 14, i &amp;lt;= nCols, i++,
	Insert Into( colnames, Column( dt, i ) &amp;lt;&amp;lt; Get Name )
);

GroupColNames = {"X__1", "X__3", "X__10"};



//create summary expression with dynamic column insertion
Eval(
	Eval Expr(
		Data Table( "plate_data_wide_for_dynamic_summary Anonymized" ) &amp;lt;&amp;lt;
		Summary(
			Group( Expr( GroupColNames ) ),
			Median( Expr( colnames ) ),
			Freq( "None" ),
			Weight( "None" ),
			output table name( "Summarized by PC plate_well wide" )
		)
	)
);




&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Aug 2025 17:16:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Dynamically-passing-a-set-of-columns-to-a-table-summary-function/m-p/895384#M105602</guid>
      <dc:creator>Stefan_Moser</dc:creator>
      <dc:date>2025-08-19T17:16:40Z</dc:date>
    </item>
  </channel>
</rss>

