<?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 can I use a jmp script to select specific rows and delete specific rows using multiple arguments? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304568#M56091</link>
    <description>&lt;P&gt;Oh man, thanks. That does make sense. I replaced my code with that new line, but it still does not actually delete all the other rows that need deleted, so that I am only graphing the New Y values between 50000 and 50999. What else could I be missing?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Sep 2020 16:38:51 GMT</pubDate>
    <dc:creator>GardDog</dc:creator>
    <dc:date>2020-09-10T16:38:51Z</dc:date>
    <item>
      <title>How can I use a jmp script to select specific rows and delete specific rows using multiple arguments?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304483#M56086</link>
      <description>&lt;P&gt;I have tried looking this up in the help guide, and it looks like I am applying it correctly, but it does not seem to be working. Could someone please check if I am missing something?&lt;/P&gt;
&lt;P&gt;I have a column that I created from another column and rounded the values. I need to keep only a range of the rows based off of values in the new column. I want to keep only New Y values that are between 50000, and 50999 and delete the rest of the rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the part of my script that has this command, but it is not working. You can see the commented out line prior to the current one I am working on this was working, but now there could be other values in the range of 50000's that I need to keep.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also attached my whole script if needed as a reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

Column( dt, "X coordinate" ) &amp;lt;&amp;lt; data type( Numeric ) &amp;lt;&amp;lt; Modeling Type( Continuous ) &amp;lt;&amp;lt; Format( Best, 12 );

dt &amp;lt;&amp;lt; New Column( "New Y", Numeric, Nominal, Width( 5 ), Formula( Round( Y coordinate ) ) );

//dt &amp;lt;&amp;lt; select where( :New Y != 50503 );
dt &amp;lt;&amp;lt; select where( :New Y &amp;lt; 50000 &amp;amp; :New Y &amp;gt; 50999 );
dt &amp;lt;&amp;lt; delete rows;
dt &amp;lt;&amp;lt; New Column( "Normalized", Numeric, Continuous, Width( 10 ), Precision( 7 ), Formula( IntenCD / Col Max( IntenCD ) ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for any help with this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Symbols();
Names Default To Here( 1 );

framex_value = "";
lotid_value = "";
w = New Window( "Requested Information", // opens a window with a title and this content...
	&amp;lt;&amp;lt;Return Result,
	Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing 
		V List Box( // V and H lists nest to organize the display boxes
			H Center Box( Text Box( "Requested Information..." ) ), // a second title, centered
			Spacer Box( size( 1, 20 ) ), // a little vertical space
		    H List Box( Text Box( "             Lot#: " ), lotid = Number Edit Box( ) ), // data entry
			Spacer Box( size( 1, 10 ) ), // a little vertical space
			H List Box( Text Box( "Frame size X: " ), framex = Number Edit Box( ) ), // data entry	
			Spacer Box( size( 1, 10 ) ), // a little vertical space
			H Center Box( // center the button
				Button Box( "Create graph", // this script runs when the button is pressed...
					lotid_value = lotid &amp;lt;&amp;lt; get;
					framex_value = framex &amp;lt;&amp;lt; get;
					
					dt = Current Data Table();
					
					Column( dt, "X coordinate" ) &amp;lt;&amp;lt; data type( Numeric ) &amp;lt;&amp;lt; Modeling Type( Continuous ) &amp;lt;&amp;lt; Format( Best, 12 );
					
					dt &amp;lt;&amp;lt; New Column( "New Y", Numeric, Nominal, Width( 5 ), Formula( Round( Y coordinate ) ) );
					
					//dt &amp;lt;&amp;lt; select where( :New Y != 50503 );
					dt &amp;lt;&amp;lt; select where( :New Y &amp;lt; 50000 &amp;amp; :New Y &amp;gt; 50999 );
					dt &amp;lt;&amp;lt; delete rows;
					dt &amp;lt;&amp;lt; New Column( "Normalized", Numeric, Continuous, Width( 10 ), Precision( 7 ), Formula( IntenCD / Col Max( IntenCD ) ) );
					
					// Determine Matrix
					xMat = Matrix( 76200 - (framex_value / 2) ) |/ Matrix( 76200 - (framex_value / 2) ) |/ Matrix( 76200 + (framex_value / 2) ) |/
					Matrix( 76200 + (framex_value / 2) );
					// The yMat is static
					yMat = [1, 0.92, 0.92, 1];
					
					// The overall delta
					overallDelta = Col Max( dt:Normalized ) - Col Min( dt:Normalized );
									
					//The delta between the lines
					withinOrangeDelta = Col Max(
						If( dt:X coordinate &amp;gt; (76200 - (framex_value / 2)) &amp;amp; dt:X coordinate &amp;lt; (76200 + (framex_value / 2)),
							dt:Normalized,
							.
						)
					) - Col Max( dt:Normalized ) - Col Min( dt:Normalized ) + 1;
					Col Min( If( dt:X coordinate &amp;gt; (76200 - (framex_value / 2)) &amp;amp; dt:X coordinate &amp;lt; (76200 + (framex_value / 2)), dt:Normalized, . ) );
					
								// Graph Builer and Delta display
					gb = dt &amp;lt;&amp;lt; Graph Builder(
						Size( 534, 456 ),
						Show Control Panel( 0 ),
						Variables( X( dt:X Coordinate ), Y( dt:Normalized ) ),
						Elements( Points( X, Y, Legend( 5 ) ) )
					);
					
					Report( gb )[FrameBox( 1 )] &amp;lt;&amp;lt; Add Graphics Script(
						Pen Color( "orange" );
						Pen Size( 2 );
						Line( xmat, ymat );
													
													// Add the results to the chart
						Text( Boxed, {75000, .94}, "Overall Delta = " || Char( Format( overallDelta, 7, 4 ) ) );
						Text( Boxed, {75000, .93}, "Within Frame Delta = " || Char( Format( withinOrangeDelta, 7, 4 ) ) );
					);
					Report( gb )[AxisBox( 2 )] &amp;lt;&amp;lt; Min( .91 );
					
					Report( gb )&amp;lt;&amp;lt;save picture( "\\bofs23b\aera_data\Pellicle_Transmission/" || Char( lotid_value ) ||".jpg", "jpg" );
					
					//allTransmissions = Format( overallDelta, 7, 4, withinOrangeDelta, 7, 4);
					//A = [1 2 3]; B = [4 5 6]; Concat To( A, B ); Show( A );
					A = Char( Format( overallDelta, 7, 4 ) );
					B = ",";
					C = " ";
					D = Char( Format( withinOrangeDelta, 7, 4 ) );
					Concat To(A, B, C, D);
					Save Text File( "\\bofs23b\aera_data\Pellicle_Transmission\" || Char( lotid_value ) ||".txt", A);

										
					w &amp;lt;&amp;lt; closeWindow;

				)
			)
		)
	)
  
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:37:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304483#M56086</guid>
      <dc:creator>GardDog</dc:creator>
      <dc:date>2023-06-09T23:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a jmp script to select specific rows and delete specific rows using multiple arguments?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304510#M56089</link>
      <description>&lt;P&gt;I think it's just a logic problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your select where statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; select where( :New Y &amp;lt; 50000 &amp;amp; :New Y &amp;gt; 50999 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;can never be true since :New Y can't be less than 50000 &lt;EM&gt;and&lt;/EM&gt; greater than 50999 at the same time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead, you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; select where( 50000 &amp;lt;= :New Y &amp;lt;= 50999 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 16:19:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304510#M56089</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2020-09-10T16:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a jmp script to select specific rows and delete specific rows using multiple arguments?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304568#M56091</link>
      <description>&lt;P&gt;Oh man, thanks. That does make sense. I replaced my code with that new line, but it still does not actually delete all the other rows that need deleted, so that I am only graphing the New Y values between 50000 and 50999. What else could I be missing?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 16:38:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304568#M56091</guid>
      <dc:creator>GardDog</dc:creator>
      <dc:date>2020-09-10T16:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a jmp script to select specific rows and delete specific rows using multiple arguments?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304667#M56094</link>
      <description>It is tough to debug without sample data.....could you possibly provide a sample table</description>
      <pubDate>Thu, 10 Sep 2020 16:55:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304667#M56094</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-09-10T16:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a jmp script to select specific rows and delete specific rows using multiple arguments?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304735#M56097</link>
      <description>&lt;P&gt;Yes, here is one of my data sets, thanks for the help!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 17:25:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/304735#M56097</guid>
      <dc:creator>GardDog</dc:creator>
      <dc:date>2020-09-10T17:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a jmp script to select specific rows and delete specific rows using multiple arguments?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/306854#M56194</link>
      <description>&lt;P&gt;Hi, I still cannot figure out how to get all but a specific range of Y coordinates to be deleted. With the update from previous help this is my new script for the section I am working on. So I need to keep only Y values from 50000 to 50999, and delete the rest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

Column( dt, "X coordinate" ) &amp;lt;&amp;lt; data type( Numeric ) &amp;lt;&amp;lt; Modeling Type( Continuous ) &amp;lt;&amp;lt; Format( Best, 12 );

dt &amp;lt;&amp;lt; New Column( "New Y", Numeric, Continuous, Width( 10 ), Formula( Round( Y coordinate, 0 ) ) );

//dt &amp;lt;&amp;lt; select where( :New Y != 50503 );
dt &amp;lt;&amp;lt; select where( 50000 &amp;lt;= :New Y &amp;lt;= 50999 );
dt &amp;lt;&amp;lt; delete rows;
dt &amp;lt;&amp;lt; New Column( "Normalized",
    Numeric,
    Continuous,
    Width( 10 ),
    Precision( 7 ),
    Formula( IntenCD / Col Max( IntenCD ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Sep 2020 18:15:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/306854#M56194</guid>
      <dc:creator>GardDog</dc:creator>
      <dc:date>2020-09-14T18:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a jmp script to select specific rows and delete specific rows using multiple arguments?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/306858#M56197</link>
      <description>&lt;P&gt;Here is the Select Where() clause you want to use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; select where( :New Y &amp;lt;= 50000 | :New Y &amp;gt;= 50999 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Sep 2020 16:52:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/306858#M56197</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-09-14T16:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a jmp script to select specific rows and delete specific rows using multiple arguments?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/306923#M56202</link>
      <description>&lt;P&gt;Perfect, that did the trick. Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 18:26:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-use-a-jmp-script-to-select-specific-rows-and-delete/m-p/306923#M56202</guid>
      <dc:creator>GardDog</dc:creator>
      <dc:date>2020-09-14T18:26:34Z</dc:date>
    </item>
  </channel>
</rss>

