<?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 Which Are Empty For All Columns in a List in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870701#M103426</link>
    <description>&lt;P&gt;Does your data cols include what you are looking for? Also, you have to adjust the 2 to fit your data, dynamic option such as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rows_to_delete = Loc(V Sum(m`) == N Items(cols_to_check));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;might be a good idea&lt;/P&gt;</description>
    <pubDate>Tue, 29 Apr 2025 04:32:32 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-04-29T04:32:32Z</dc:date>
    <item>
      <title>Delete Rows Which Are Empty For All Columns in a List</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870313#M103354</link>
      <description>&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Remove-rows-with-one-or-more-empty-values-using-JSL/m-p/869260#M103212" target="_blank"&gt;Solved: Re: Remove rows with one or more empty values using JSL - Page 2 - JMP User Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Based on the above discussion, I have a script to delete empty rows but it appears to delete those where they are empty in ANY of the listed columns, whereas I want to delete those where ALL are empty for the listed columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;// Get the current data table
dt = Current Data Table();

// Get all column names as strings
cnmes = dt &amp;lt;&amp;lt; Get Column Names("string");

// Initialize Start and End indices
Start = .;
End = .;

// Find the index of the "Start" column
For(i = 1, i &amp;lt;= N Items(cnmes), i++,
    If(Contains(cnmes[i], "Start"),
        Start = i + 1;
        Break(); // Exit loop once found
    );
);

// Find the index of the "End" column
For(j = 1, j &amp;lt;= N Items(cnmes), j++,
    If(Contains(cnmes[j], "End"),
        End = j-1;
        Break(); // Exit loop once found
    );
);

datacols = {};

For(k = start, k &amp;lt;= End, k++,
    Insert into (datacols, cnmes[k]) // Determine Data Columns
);

keeprows = Loc Nonmissing( datacols );
dt &amp;lt;&amp;lt; select rows( keeprows ) &amp;lt;&amp;lt; invert Row Selection &amp;lt;&amp;lt; delete rows;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2025 21:59:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870313#M103354</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-04-25T21:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Rows Which Are Empty For All Columns in a List</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870324#M103355</link>
      <description>&lt;P&gt;Have you studied the JSL enough so you understand why it does not do what you need it to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take a look in the Scripting Guide on Select Where&lt;/P&gt;
&lt;P&gt;You will need to find all of the rows that have missing values for the first column in datacols then from that list of rows, select the rows that have missing values for the second column, then the thrid, etc. until you reach the last column in the datacols list.&lt;/P&gt;
&lt;P&gt;The rows that remain after that, will&amp;nbsp; only those rows with missing values for all of the columns in datacols.&lt;/P&gt;
&lt;P&gt;Then all you have to do is delete those remaining rows.&lt;/P&gt;
&lt;P&gt;Look into the Current Selection() element of the Select Where() function.&amp;nbsp; It will restrict the each subsequent Select Where to only look at the previously selected rows when applying the selection.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Apr 2025 02:21:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870324#M103355</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-04-26T02:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Rows Which Are Empty For All Columns in a List</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870325#M103356</link>
      <description>&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe I understand it, born to fail it was.&amp;nbsp; Your idea however is Nice!&amp;nbsp; Here's how that looks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
dt = Current Data Table();

// Get all column names as strings
cnmes = dt &amp;lt;&amp;lt; Get Column Names("string");

// Initialize Start and End indices
Start = .;
End = .;

// Find the index of the "Start" column
For(i = 1, i &amp;lt;= N Items(cnmes), i++,
    If(Contains(cnmes[i], "Start"),
        Start = i + 1;
        Break(); // Exit loop once found
    );
);

// Find the index of the "End" column
For(j = 1, j &amp;lt;= N Items(cnmes), j++,
    If(Contains(cnmes[j], "End"),
        End = j-1;
        Break(); // Exit loop once found
    );
);

For(l = Start, l &amp;lt;= End, l++,
full_rows = dt &amp;lt;&amp;lt; get rows where( !Is Missing( As Column(cnmes[l]) ) );
For Each Row(If(is missing(cnmes[i]), Remove From(full_rows))));

dt &amp;lt;&amp;lt; Select Rows(full_rows) &amp;lt;&amp;lt; Invert Row Selection &amp;lt;&amp;lt; Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Apr 2025 02:46:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870325#M103356</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-04-26T02:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Rows Which Are Empty For All Columns in a List</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870326#M103357</link>
      <description>&lt;P&gt;Does this work?&amp;nbsp; I don't see how it would.&amp;nbsp; You are treating each column independently from each other.&amp;nbsp; You are resetting full_rows for each column.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of using multiple select where()_to narrow down the rows you want to select&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt = 
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );

// Select all males
dt &amp;lt;&amp;lt; select where( :Sex == "M");

// From all of the selected males, select all of the 12 year olds
dt &amp;lt;&amp;lt; select where( :age == 12, Current Selection("Restrict"));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Apr 2025 03:03:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870326#M103357</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-04-26T03:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Rows Which Are Empty For All Columns in a List</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870330#M103358</link>
      <description>&lt;P&gt;I'm not exactly sure what is going on on your first part of script or how it is related to this question (to create list of the columns?) but you can this: using JMP platform (missing data pattern), select where (like Jim suggested) or for example with data table subscripting + loop / data table subscripting + some matrix operations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First I would try with Missing Data platform JMP offers. See if it can be used for this (it can), after that look into the Select Where option Jim suggested. After you&amp;nbsp;can script AND understand how Jim's suggestion works, then you can start looking into the data table subscription options I suggest below if you still want to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Missing data pattern&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/18.2/#page/jmp/view-patterns-of-missing-data-in-data-tables.shtml?os=win&amp;amp;source=application#ww731233" target="_blank" rel="noopener"&gt; Using JMP &amp;gt; Enter and Edit Your Data &amp;gt; Organize Data in Data Tables &amp;gt; View Patterns of Missing Data in Data Tables&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/18.2/#page/jmp/find-missing-data-patterns.shtml" target="_blank" rel="noopener"&gt;Scripting Guide &amp;gt; Data Tables &amp;gt; Advanced Data Table Scripting &amp;gt; Find Missing Data Patterns&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1745642082516.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75195i0FA05746D854B554/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1745642082516.png" alt="jthi_0-1745642082516.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1745642092366.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75196iB9F183D32F00E00B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1745642092366.png" alt="jthi_1-1745642092366.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This uses matrix operations and I think it should work&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);

dt = New Table("Untitled",
	Add Rows(11),
	Compress File When Saved(1),
	New Column("Column 1", Character, "Nominal", Set Values({"", "", "aa", "", "a", "a", "", "a", "", "a", ""})),
	New Column("Column 2", Character, "Nominal", Set Values({"", "a", "a", "a", "a", "", "", "a", "a", "", ""})),
	New Column("Column 3", Character, "Nominal", Set Values({"a", "", "a", "", "a", "", "a", "", "", "", "a"}))
);

cols_to_check = {"Column 2", "Column 3"};

m = Matrix(IsMissing(dt[0, cols_to_check]));
rows_to_delete = Loc(V Sum(m`) == 2);
dt &amp;lt;&amp;lt; select rows(rows_to_delete); // for demo purposes
dt &amp;lt;&amp;lt; Delete Rows(rows_to_delete); // use this in real use case
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This would loop over the rows while checking for missing values&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rows_to_delete = {};
For Each Row(dt,
	m = Loc Nonmissing(dt[Row(), cols_to_check]);
	If(N Items(m) == 0,
		Insert Into(rows_to_delete, Row());
	);
);
dt &amp;lt;&amp;lt; Select Rows(rows_to_delete);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Apr 2025 04:37:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870330#M103358</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-04-26T04:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Rows Which Are Empty For All Columns in a List</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870359#M103360</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;is missing (list)&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;is missing (matrix)&amp;nbsp;&lt;BR /&gt;&lt;/FONT&gt;nice! - and unexpected.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1745653505288.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75200i2B6D1D8EACEF1AFD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1745653505288.png" alt="hogi_0-1745653505288.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1745653519976.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/75201i1C20D633BEBBDBA7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1745653519976.png" alt="hogi_1-1745653519976.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;is there a general overview which JSL functions can be "vectorized"?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Apr 2025 07:58:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870359#M103360</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-04-26T07:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Rows Which Are Empty For All Columns in a List</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870653#M103416</link>
      <description>&lt;P&gt;I thought the script worked but it has a flaw as you point out.&amp;nbsp; I tried @Jarmo's idea and it works but it doesn't populate the matrix for me.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Get the current data table
dt = Current Data Table();

// Get all column names as strings
cnmes = dt &amp;lt;&amp;lt; Get Column Names("string");

// Initialize Start and End indices
Start = .;
End = .;

// Find the index of the "Device 2" column
For(i = 1, i &amp;lt;= N Items(cnmes), i++,
    If(Contains(cnmes[i], "Device 2"),
        Start = i + 1;
        Break(); // Exit loop once found
    );
);

// Find the index of the "Process Script" column
For(j = 1, j &amp;lt;= N Items(cnmes), j++,
    If(Contains(cnmes[j], "start_date"),
        End = j-1;
        Break(); // Exit loop once found
    );
);

datacols = {};

For(k = start, k &amp;lt;= End, k++,
    Insert into (datacols, cnmes[k]) // Determine Data Columns
);

m = Matrix(IsMissing(dt[0, datacols]));
rows_to_delete = Loc(V Sum(m`) == 2);
dt &amp;lt;&amp;lt; select rows(rows_to_delete); // for demo purposes
dt &amp;lt;&amp;lt; Delete Rows(rows_to_delete); // use this in real use case&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 20:14:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870653#M103416</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-04-28T20:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Rows Which Are Empty For All Columns in a List</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870701#M103426</link>
      <description>&lt;P&gt;Does your data cols include what you are looking for? Also, you have to adjust the 2 to fit your data, dynamic option such as&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;rows_to_delete = Loc(V Sum(m`) == N Items(cols_to_check));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;might be a good idea&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 04:32:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870701#M103426</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-04-29T04:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Rows Which Are Empty For All Columns in a List</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870948#M103455</link>
      <description>&lt;P&gt;Jarmo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That did the trick.&amp;nbsp; Was actually wondering the significance of the 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 15:39:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-Rows-Which-Are-Empty-For-All-Columns-in-a-List/m-p/870948#M103455</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-04-29T15:39:45Z</dc:date>
    </item>
  </channel>
</rss>

