<?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: Delete rows based upon condition in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Delete-rows-based-upon-condition/m-p/49912#M28385</link>
    <description>&lt;P&gt;I am not sure what you are actually asking for.&amp;nbsp; Therefore, I am including 2 different scripts.&amp;nbsp; The first one deletes all of the rows that meet your condition of values &amp;gt; 67.&amp;nbsp; When you delete rows, it deletes the entire row, so the results of this script deletes all but 2 rows.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

column_list = {"height", "weight"};

For( i = N Items( column_list ), i &amp;gt; 0, i--,
	dt &amp;lt;&amp;lt; Select Where( as column(column_list[i]) &amp;gt; 67 );
	dt &amp;lt;&amp;lt; delete rows;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But what I think you might be trying to do, is to eliminate the values in the columns where the value of height and weight are &amp;gt; 67.&amp;nbsp; This script replaces the values of height and weight with missing values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

column_list = {"height", "weight"};

For( i = N Items( column_list ), i &amp;gt; 0, i--,
	SelectedRows = dt &amp;lt;&amp;lt; get rows Where( as column(column_list[i]) &amp;gt; 67 );
	column(column_List[i])[Selected Rows] = .;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Jan 2018 00:46:11 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-01-22T00:46:11Z</dc:date>
    <item>
      <title>Delete rows based upon condition</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-rows-based-upon-condition/m-p/49909#M28382</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to use for loop to delete my columns. Below is an example but I have more columsn.&lt;/P&gt;&lt;P&gt;Also, how you treat columns with white space in between like "color size".&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&lt;BR /&gt;&lt;BR /&gt;dt = Open( "$SAMPLE_DATA\Big Class.jmp" );


column_list = Words( "heigth", "weight" );

For( i = N Items( column_list ), i &amp;gt; 0, i--,
	dt &amp;lt;&amp;lt; Select Where( :column_list[i] &amp;gt; 67 );
	dt &amp;lt;&amp;lt; delete rows;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 Jan 2018 23:17:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-rows-based-upon-condition/m-p/49909#M28382</guid>
      <dc:creator>sam_t</dc:creator>
      <dc:date>2018-01-21T23:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Delete rows based upon condition</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-rows-based-upon-condition/m-p/49912#M28385</link>
      <description>&lt;P&gt;I am not sure what you are actually asking for.&amp;nbsp; Therefore, I am including 2 different scripts.&amp;nbsp; The first one deletes all of the rows that meet your condition of values &amp;gt; 67.&amp;nbsp; When you delete rows, it deletes the entire row, so the results of this script deletes all but 2 rows.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

column_list = {"height", "weight"};

For( i = N Items( column_list ), i &amp;gt; 0, i--,
	dt &amp;lt;&amp;lt; Select Where( as column(column_list[i]) &amp;gt; 67 );
	dt &amp;lt;&amp;lt; delete rows;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But what I think you might be trying to do, is to eliminate the values in the columns where the value of height and weight are &amp;gt; 67.&amp;nbsp; This script replaces the values of height and weight with missing values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );

column_list = {"height", "weight"};

For( i = N Items( column_list ), i &amp;gt; 0, i--,
	SelectedRows = dt &amp;lt;&amp;lt; get rows Where( as column(column_list[i]) &amp;gt; 67 );
	column(column_List[i])[Selected Rows] = .;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jan 2018 00:46:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-rows-based-upon-condition/m-p/49912#M28385</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-01-22T00:46:11Z</dc:date>
    </item>
  </channel>
</rss>

