<?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: Strange behaviour of script generated formula column; no data until I copy+paste the column in the same datatable in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Strange-behaviour-of-script-generated-formula-column-no-data/m-p/573167#M78212</link>
    <description>&lt;P&gt;It seems like your force column's name is wrong in the formula until you rename it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
Column Die strength Formula Interrupted
Name Unresolved: Force at row 1 in access or evaluation of 'Force' , :Force/*###*/
Formula evaluation errors have been ignored
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 24 Nov 2022 12:26:52 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-11-24T12:26:52Z</dc:date>
    <item>
      <title>Strange behaviour of script generated formula column; no data until I copy+paste the column in the same datatable</title>
      <link>https://community.jmp.com/t5/Discussions/Strange-behaviour-of-script-generated-formula-column-no-data/m-p/573130#M78204</link>
      <description>&lt;P&gt;I have a script that loads data from excel and then generates a new formula column. The column appears empty however, even though my formula preview shows values. Once I copy/paste the column into the same datatable suddenly the values appear. What's going on here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Easiest demo is through the gif below. I also added the script and excel sheet.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mvanderaa1_0-1669279319051.gif" style="width: 634px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47594iB05D8A8473B54B97/image-dimensions/634x353?v=v2" width="634" height="353" role="button" title="mvanderaa1_0-1669279319051.gif" alt="mvanderaa1_0-1669279319051.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

//Prompt to select and open an MS Excel file
path = Pick File( "Select Excel File", "$DOCUMENTS", {"Excel Files|csv;xlsx;xls", "All Files|*"}, 1, 0 );
fname = Word( 1, Word( -1, path, "/" ), "." );

//Let the user choose the name of the datatable
w = New Window( "Choose datatable name", // opens a window with a title and this content...
	&amp;lt;&amp;lt;Modal,
	H List Box( Text Box( "Name: " ), tbox = Text Edit Box( fname ) ), // data entry          
	// optionally, close the dialog. Or, you might want to run it again...
	H List Box(
		Button Box( "OK",
			fname = tbox &amp;lt;&amp;lt; get text(); // data entry                            
			Button Box( "Cancel" );
		)
	)
);
dt = Open( path );

//Extract the die strength measurement conditions from the datatable and move to table variables
dt &amp;lt;&amp;lt; Set Name( fname );
tableVariables = {"Thickness (um)", "Width (mm)", "L (mm)"};
For Each( {var, index}, tableVariables,
	dt &amp;lt;&amp;lt; Set Table Variable( var, As Column( var )[1] );
	dt &amp;lt;&amp;lt; delete column( Column( var ) );
);

col_name_list = dt &amp;lt;&amp;lt; get column names( string );

// Check if the die strength column exists, otherwise calculate from the force and measurement conditions
If( !Contains( col_name_list, "Die strength (MPa)" ),
dt &amp;lt;&amp;lt; New Column( "Die strength", Numeric,
		"Continuous",
		Formula( 3 * :Force * :"L (mm)"n / ((:"Thickness (um)"n * 0.001) ^ 2 * 2 * :"Width (mm)"n) )
		 ),
dt:"Die strength (MPa)"n &amp;lt;&amp;lt; Set Name( "Die strength" );
);

//Rename the Die strength and force columns and set their respective units
dt:"Die strength"n &amp;lt;&amp;lt; Set Property( "Units", "MPa" );
dt:"Force (N)"n &amp;lt;&amp;lt; Set Property( "Units", "N" );
dt:"Force (N)"n &amp;lt;&amp;lt; Set Name( "Force" );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:03:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Strange-behaviour-of-script-generated-formula-column-no-data/m-p/573130#M78204</guid>
      <dc:creator>mvanderaa1</dc:creator>
      <dc:date>2023-06-09T16:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behaviour of script generated formula column; no data until I copy+paste the column in the same datatable</title>
      <link>https://community.jmp.com/t5/Discussions/Strange-behaviour-of-script-generated-formula-column-no-data/m-p/573167#M78212</link>
      <description>&lt;P&gt;It seems like your force column's name is wrong in the formula until you rename it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
Column Die strength Formula Interrupted
Name Unresolved: Force at row 1 in access or evaluation of 'Force' , :Force/*###*/
Formula evaluation errors have been ignored
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Nov 2022 12:26:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Strange-behaviour-of-script-generated-formula-column-no-data/m-p/573167#M78212</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-11-24T12:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behaviour of script generated formula column; no data until I copy+paste the column in the same datatable</title>
      <link>https://community.jmp.com/t5/Discussions/Strange-behaviour-of-script-generated-formula-column-no-data/m-p/573202#M78216</link>
      <description>&lt;P&gt;Edit: Ok I see now, I'm changing the variable name later in the script. So the Force column name reference is not correct at the time of creating the column.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 15:10:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Strange-behaviour-of-script-generated-formula-column-no-data/m-p/573202#M78216</guid>
      <dc:creator>mvanderaa1</dc:creator>
      <dc:date>2022-11-24T15:10:56Z</dc:date>
    </item>
  </channel>
</rss>

