<?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: Cannot perform Boolean logic using jmp script on table formula in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416663#M66584</link>
    <description>&lt;P&gt;I'm afraid I'm having trouble reproducing any problem here. Here's the script I used to test with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = New Table( "Community 416651 Select Where",
	Add Rows( 1000000 ),
	New Column( "x coordinate",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( Sequence( 5, 100, 5 ) ),
		Set Selected
	),
	New Column( "y coordinate",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( Sequence( 5, 100, 5, 20 ) ),

	)
);

dt1 &amp;lt;&amp;lt; New Column( "Radial",
	Formula(
		(X coordinate ^ 2 + Y coordinate ^ 2) ^ (1 / 2)
	)
);

dt1 &amp;lt;&amp;lt; Select where( Radial &amp;lt; 60 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, we're going to need a little more detail about your script and your data table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How big is your data table? What else is your script doing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Sep 2021 23:34:59 GMT</pubDate>
    <dc:creator>Jeff_Perkinson</dc:creator>
    <dc:date>2021-09-08T23:34:59Z</dc:date>
    <item>
      <title>Cannot perform Boolean logic using jmp script on table formula</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416646#M66580</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to run a simple script that will select and then hide and exclude points that are greater than 100 mm in radial distance from the center.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To simplify debugging, I split this into two scripts: the first one generates a column with the radial distance Radial = (x^2 + y^2)^(1/2) formula and the second evaluates this formula, selecting and hiding rows where Radial &amp;gt; 100.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately this does not work. For some very strange reason, evaluation only works on this formula up to a certain value. Radial &amp;gt; (anything over 30) selects all rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see two solutions:&lt;/P&gt;&lt;P&gt;1) Write values into the Radial column, not the formula itself. (Values are evaluated properly, the formula is not). Not sure how to do this.&lt;/P&gt;&lt;P&gt;2) Understand and correct the problem so that the formula can be evaluated against a value greater than 30.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Either a scripting answer or interactive explanation would be acceptable. Would like to resolve this problem and learn from it.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// script for creating the Radial column&lt;BR /&gt;dt1 = Current Data Table ();
dt1 &amp;lt;&amp;lt; New Column( "Radial", Formula ((X coordinate^2 + Y coordinate^2)^(1/2)));&lt;BR /&gt;&lt;BR /&gt;//&amp;nbsp;script&amp;nbsp;for&amp;nbsp;evaluating&amp;nbsp;the&amp;nbsp;Radial&amp;nbsp;formula&lt;BR /&gt;dt =Current Data Table();&lt;BR /&gt;dt &amp;lt;&amp;lt; Clear Row States; &lt;BR /&gt;dt &amp;lt;&amp;lt; Select where(Radial &amp;lt; 100);&lt;BR /&gt;dt &amp;lt;&amp;lt; hide and exclude;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:56:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416646#M66580</guid>
      <dc:creator>dsoltz1</dc:creator>
      <dc:date>2023-06-09T19:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot perform Boolean logic using jmp script on table formula</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416651#M66581</link>
      <description>&lt;P&gt;script for creating the Radial column&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = Current Data Table ();
dt1 &amp;lt;&amp;lt; Clear Row States;
dt1 &amp;lt;&amp;lt; New Column( "Radial", Formula ((X coordinate^2 + Y coordinate^2)^(1/2)));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;script for evaluating the Radial formula&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt =Current Data Table();
dt &amp;lt;&amp;lt; Clear Row States; 
dt &amp;lt;&amp;lt; Select where(Radial &amp;lt; 100);
dt &amp;lt;&amp;lt; hide and exclude;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Sep 2021 22:41:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416651#M66581</guid>
      <dc:creator>dsoltz1</dc:creator>
      <dc:date>2021-09-08T22:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot perform Boolean logic using jmp script on table formula</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416663#M66584</link>
      <description>&lt;P&gt;I'm afraid I'm having trouble reproducing any problem here. Here's the script I used to test with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = New Table( "Community 416651 Select Where",
	Add Rows( 1000000 ),
	New Column( "x coordinate",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( Sequence( 5, 100, 5 ) ),
		Set Selected
	),
	New Column( "y coordinate",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( Sequence( 5, 100, 5, 20 ) ),

	)
);

dt1 &amp;lt;&amp;lt; New Column( "Radial",
	Formula(
		(X coordinate ^ 2 + Y coordinate ^ 2) ^ (1 / 2)
	)
);

dt1 &amp;lt;&amp;lt; Select where( Radial &amp;lt; 60 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, we're going to need a little more detail about your script and your data table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How big is your data table? What else is your script doing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 23:34:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416663#M66584</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2021-09-08T23:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot perform Boolean logic using jmp script on table formula</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416678#M66587</link>
      <description>&lt;P&gt;Thanks for replying Jeff.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pasting the last line of your script into mine did not resolve the problem. However I was able to come with a solution by changing the name of the column to "Radial 1" and adding a line with Eval Formula at the end. Not sure why this works. The data table is about 1,300 rows with 15 columns, each number has a width of 10 to 12.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following two scripts work. Am pasting them in their entirety. The other lines evaluate pit depth and distribution.&lt;/P&gt;&lt;P&gt;Any idea why the modifications worked? I have been at this for most of the day.&lt;/P&gt;&lt;P&gt;Script 1: Create "Pits Only" and "Radial 1" columns&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = Current Data Table ();
dt1 &amp;lt;&amp;lt; Clear Row States;
dt1 &amp;lt;&amp;lt; New Column( "Pits Only", Formula (If( :Name( "Height (mm)" ) &amp;lt;= 0,	:Name( "Height (mm)"), 0 )) );
dt1 &amp;lt;&amp;lt; New Column( "Radial 1", Formula ((X coordinate^2 + Y coordinate^2)^(1/2)));
dt1 &amp;lt;&amp;lt; Eval Formula;
obj = dt1 &amp;lt;&amp;lt; Distribution( Column( :Pits Only), Horizontal Layout( 1 ), Count Axis);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Script 2: Hide and Exclude rows with Pits Only &amp;gt; 10 or Radial 1 &amp;gt; 100 or Radial 1 &amp;lt; 30&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt =Current Data Table();
dt &amp;lt;&amp;lt; Clear Row States; 
	win = New Window( "Feature Depth" , &amp;lt;&amp;lt;Modal, &amp;lt;&amp;lt;Return Result,
	Text Box( "Input Min Feature Depth" ),
	minfeat_abs = Number Edit Box( 4 ), 
 );

 mf = win["minfeat_abs"];

 mf = -mf/1000;

// show (mf);

dt &amp;lt;&amp;lt; Select where((Radial 1&amp;gt; 100) | (Radial 1&amp;lt; 30) | (Pits Only &amp;gt; mf));
dt &amp;lt;&amp;lt; hide and exclude;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 00:46:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416678#M66587</guid>
      <dc:creator>dsoltz1</dc:creator>
      <dc:date>2021-09-09T00:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot perform Boolean logic using jmp script on table formula</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416685#M66588</link>
      <description>&lt;P&gt;I am doing a bit of guessing, but I believe that your issue with Radial vs Radial 1 is your not scoping your column variable correctly.&amp;nbsp; In your statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Select where((Radial 1&amp;gt; 100) | (Radial 1&amp;lt; 30) | (Pits Only &amp;gt; mf));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;you should be placing a ":" in front of the column names :Radial 1 and :Pits Only.&amp;nbsp; The reason that the script is working with Radial 1, is that there is not a memory variable called Radial 1, in which JMP can get confused with.&amp;nbsp; It is my assumption that at some point in your coding attempts, that you in accidently created a memory variable of Radial, so when you specified&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Select where((Radial&amp;gt; 100) | (Radial&amp;lt; 30) | (Pits Only &amp;gt; mf));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;JMP was replacing value for Radial with the memory variables value, not the column Radial's value.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 01:33:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-Boolean-logic-using-jmp-script-on-table-formula/m-p/416685#M66588</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-09T01:33:12Z</dc:date>
    </item>
  </channel>
</rss>

