<?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 do I delete rows that are missing data in all columns of my dataset? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/317355#M56867</link>
    <description>&lt;P&gt;As shown by earlier replies, there are often many ways to perform a task in JMP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all columns 4-14 are numeric, this script should also work to delete rows with missing values only.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

dt &amp;lt;&amp;lt; Delete Rows(Loc(Is Missing(V Mean(dt[0, 4 :: 14]`))));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 06 Oct 2020 15:00:21 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2020-10-06T15:00:21Z</dc:date>
    <item>
      <title>How do I delete rows that are missing data in all columns of my dataset?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/315561#M56765</link>
      <description>&lt;P&gt;Apologies for how basic my question is, I am just starting to use JMP for the first time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a massive dataset (14 columns x 20,000 rows) and I am trying to write a script that will identify and delete all rows that that do not have either a 0 or 1 for a specific range of columns (columns 4-14). This dataset is from an even larger dataset, so there are some rows in my subset that are completely empty. Here's an example of what I was hoping to do:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;- - - - - 
0 0 1 - 0
- - - - -
1 - - - -&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;becomes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;0 0 1 - 0
1 - - - -&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've started writing the code, but I'm stuck–I'm not sure what to do after the For Each Row. I was hoping that this script would look at one row at a time, and if a particular cell did not have a 0 or a 1, it would look for a 0 or a 1 in the next column, and if it got to the end of the row with no 0s or 1s, then it would delete that entire row. Here is my code so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=Open("File Name")

colnames = dt &amp;lt;&amp;lt; get column names( numeric,string );
For( i = 4, i &amp;lt;= N Items( colnames ), i++,
	For Each Row(If(:colnames != 0 | :colnames != 1), Continue()
		
	
	)
	
	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I was thinking about using&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt; Delete Rows&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;, which I've seen on some other questions on this forum. If this is too complicated with a script, is there a better way to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:39:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/315561#M56765</guid>
      <dc:creator>Ducky</dc:creator>
      <dc:date>2023-06-09T23:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete rows that are missing data in all columns of my dataset?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/315580#M56766</link>
      <description>&lt;P&gt;Does this need to be a script?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you find just one row that is missing those specific cells, select the missing cells.&lt;/P&gt;
&lt;P&gt;Now go to the Rows menu and select Row Selection &amp;gt; Select Matching Cells.&lt;/P&gt;
&lt;P&gt;Now every row that is missing data in those columns will be selected. Choose Rows &amp;gt; Delete Rows.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 00:17:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/315580#M56766</guid>
      <dc:creator>Dan_Obermiller</dc:creator>
      <dc:date>2020-10-02T00:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete rows that are missing data in all columns of my dataset?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/315582#M56767</link>
      <description>&lt;P&gt;I think you need to look at the Missing Data Pattern platform:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables=&amp;gt;Missing Data Pattern&lt;/P&gt;
&lt;P&gt;From your descripting, it sounds like it will meet your needs.&amp;nbsp; It will analyze the columns you specify and then from the data table it produces, you can select the columns will all missing values, and then delete them.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 00:32:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/315582#M56767</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-10-02T00:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete rows that are missing data in all columns of my dataset?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/315603#M56768</link>
      <description>&lt;P&gt;or if you want to script it, this is my suggestion:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column("Selected", Character, Nominal, Formula(
   If(Is Missing(:Column4) | Is Missing(:Column5)|...until column14,
        "Yes",
        "No"
   )
));

dt &amp;lt;&amp;lt; Select Where(:Selected == "Yes");
dt &amp;lt;&amp;lt; Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Oct 2020 03:45:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/315603#M56768</guid>
      <dc:creator>ThuongLe</dc:creator>
      <dc:date>2020-10-02T03:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete rows that are missing data in all columns of my dataset?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/315662#M56777</link>
      <description>&lt;P&gt;This script will take care of your request. It is not entirely unique of the other replies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

// get reference to target data table
dt = Current Data Table();

// get all the columns for missing value check
cols = dt &amp;lt;&amp;lt; Get Column Names;

// obtain missing value patterns
missing = Current Data Table() &amp;lt;&amp;lt; Missing Data Pattern(
	Columns( Eval( cols ) ),
	Output Table( "Missing Data Pattern" )
);

// make character string representing missing values in all columns
n missing = N Items( cols );
all missing = Repeat( "1", n missing );

// find the row of patterns where all columns are missing.
missing &amp;lt;&amp;lt; Select Where( :Patterns == all missing );

// delete the linked rows in the original table
dt &amp;lt;&amp;lt; Delete Rows;

// clean up
Close( missing, No Save );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Oct 2020 15:59:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/315662#M56777</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-10-02T15:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete rows that are missing data in all columns of my dataset?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/317355#M56867</link>
      <description>&lt;P&gt;As shown by earlier replies, there are often many ways to perform a task in JMP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all columns 4-14 are numeric, this script should also work to delete rows with missing values only.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

dt &amp;lt;&amp;lt; Delete Rows(Loc(Is Missing(V Mean(dt[0, 4 :: 14]`))));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Oct 2020 15:00:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/317355#M56867</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2020-10-06T15:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete rows that are missing data in all columns of my dataset?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/892156#M105312</link>
      <description>&lt;P&gt;many thanks - a&amp;nbsp;collection of wonderful secrets!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;data table indexing&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;V Mean() -&amp;nbsp;&lt;/FONT&gt;to aggregate the information about "missing"&amp;nbsp; entries&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;Loc()&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="courier new,courier"&gt;Delete Rows (row) **)&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;**) together with &lt;FONT face="courier new,courier"&gt;where(dt, is missing ...))&lt;/FONT&gt;, it's orders of magnitude faster than:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1754291609881.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/79557i24A048CEB2CFE5CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1754291609881.png" alt="hogi_0-1754291609881.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;+ select where()&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 09:20:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-that-are-missing-data-in-all-columns-of-my/m-p/892156#M105312</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-08-06T09:20:35Z</dc:date>
    </item>
  </channel>
</rss>

