<?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 Tell JMP to continue running the Script when Column is Missing in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-Tell-JMP-to-continue-running-the-Script-when-Column-is/m-p/427783#M67721</link>
    <description>&lt;P&gt;You need to do a little bit of code safing on the list of columns to summarize.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;dt3 = Current Data Table();
columns to summarize = {"fail", "not assessed", "weak"};	//columns you're interestd in, may or may not exist within table
column names = dt3 &amp;lt;&amp;lt; Get Column Names( "String" );		//we need to grab the table columns to utilize only available columns
columns as names = {};						//we need to wrap both column names and our columns of interest in 
For( i = 1, i &amp;lt;= N Items( column names ), i++,			//  'As Name( ... )' to avoid issues with capitalization and such
	columns as names[i] = As Name( column names[i] )	//  loop here
);

columns to summarize within table = {};
For( i = 1, i &amp;lt;= N Items( columns to summarize ), i++,
	If( Contains( columns as names, As Name( columns to summarize[i] ) ),	// check to see that name exists as column header
		Insert Into( columns to summarize within table, columns to summarize[i] )
	)
);
Eval( Eval Expr(
	dt3 &amp;lt;&amp;lt; Summary( Expr( Substitute( columns to summarize within table, {}, Expr( Sum ) ) ) ) //fancy substitution for the summary table
) )&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 18 Oct 2021 15:29:35 GMT</pubDate>
    <dc:creator>ErraticAttack</dc:creator>
    <dc:date>2021-10-18T15:29:35Z</dc:date>
    <item>
      <title>How to Tell JMP to continue running the Script when Column is Missing</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Tell-JMP-to-continue-running-the-Script-when-Column-is/m-p/427768#M67720</link>
      <description>&lt;P&gt;Hi - when creating a summary table below, does anyone know how to code in JSL to allow the script to continue running&amp;nbsp; if any one of the columns below do not exist?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt3 &amp;lt;&amp;lt; Summary(Sum( :Fail, :Not Assessed, :Weak));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:38:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Tell-JMP-to-continue-running-the-Script-when-Column-is/m-p/427768#M67720</guid>
      <dc:creator>dn610</dc:creator>
      <dc:date>2023-06-10T23:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Tell JMP to continue running the Script when Column is Missing</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Tell-JMP-to-continue-running-the-Script-when-Column-is/m-p/427783#M67721</link>
      <description>&lt;P&gt;You need to do a little bit of code safing on the list of columns to summarize.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;dt3 = Current Data Table();
columns to summarize = {"fail", "not assessed", "weak"};	//columns you're interestd in, may or may not exist within table
column names = dt3 &amp;lt;&amp;lt; Get Column Names( "String" );		//we need to grab the table columns to utilize only available columns
columns as names = {};						//we need to wrap both column names and our columns of interest in 
For( i = 1, i &amp;lt;= N Items( column names ), i++,			//  'As Name( ... )' to avoid issues with capitalization and such
	columns as names[i] = As Name( column names[i] )	//  loop here
);

columns to summarize within table = {};
For( i = 1, i &amp;lt;= N Items( columns to summarize ), i++,
	If( Contains( columns as names, As Name( columns to summarize[i] ) ),	// check to see that name exists as column header
		Insert Into( columns to summarize within table, columns to summarize[i] )
	)
);
Eval( Eval Expr(
	dt3 &amp;lt;&amp;lt; Summary( Expr( Substitute( columns to summarize within table, {}, Expr( Sum ) ) ) ) //fancy substitution for the summary table
) )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Oct 2021 15:29:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Tell-JMP-to-continue-running-the-Script-when-Column-is/m-p/427783#M67721</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2021-10-18T15:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to Tell JMP to continue running the Script when Column is Missing</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Tell-JMP-to-continue-running-the-Script-when-Column-is/m-p/427784#M67722</link>
      <description>&lt;P&gt;I find the easiest way to do this, is to create a list of the columns available, and then reference that list in the Summary platform.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt3 = Current Data Table();
colList = dt3 &amp;lt;&amp;lt; get column names( continuous, string );
dt3 &amp;lt;&amp;lt; summary( Sum( Eval( colList ) ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are multiple ways to populate the list, and to delete items from the list.&amp;nbsp; See the documentation on manipulating lists in the Scripting Guide&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 15:33:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Tell-JMP-to-continue-running-the-Script-when-Column-is/m-p/427784#M67722</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-10-18T15:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to Tell JMP to continue running the Script when Column is Missing</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Tell-JMP-to-continue-running-the-Script-when-Column-is/m-p/427802#M67726</link>
      <description>&lt;P&gt;This worked. Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 15:49:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Tell-JMP-to-continue-running-the-Script-when-Column-is/m-p/427802#M67726</guid>
      <dc:creator>dn610</dc:creator>
      <dc:date>2021-10-18T15:49:23Z</dc:date>
    </item>
  </channel>
</rss>

