<?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 of variable column numbers when all are missing data in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51045#M28984</link>
    <description>&lt;P&gt;This is my fault.&amp;nbsp; I should have realized that a column starting with a number would confuse JMP.&amp;nbsp; I have added in :Name() functions around the references to the column names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

col_list = dt &amp;lt;&amp;lt; get column names( string );
For( i = N Items( col_list ), i &amp;gt; 0, i--,
	If( !Contains( col_list[i], "X_Clean" ),
		Remove From( col_list, i )
	)
);

theExpr = "dt &amp;lt;&amp;lt; select where(isMissing(Sum(:name(\!"" || col_list[1];

For( i = 2, i &amp;lt;= N Items( col_list ), i++, 

	theExpr = theExpr || "\!"),:name(\!"" || col_list[i]

);

theExpr = theExpr || "\!")))==1)&amp;lt;&amp;lt;delete Rows;";

Eval( Parse( theExpr ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 11 Feb 2018 04:36:05 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2018-02-11T04:36:05Z</dc:date>
    <item>
      <title>How do I delete rows of variable column numbers when all are missing data</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51024#M28971</link>
      <description>&lt;P&gt;I have an auto-generated dataset and some of the columns, those that have a substring "X_Clean" in it, will have some null values.&amp;nbsp; Sometimes there are 2, 3, 4 or even 5 different columns, depends on the dataset.&amp;nbsp; I want to delete the rows only when ALL "n" of these "X_Clean" columns have null values but never if at least one of them is populated with a value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was thinking of doing a FOR loop to generate the column list of interest, and this works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;col_list = dt &amp;lt;&amp;lt;get column names(string);
	for(i=nitems(col_list), i&amp;gt;0, i--,
		if(!contains(col_list[i], "X_Clean"),
				remove from(col_list, i);
		));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But then I'm not sure of the next step.&amp;nbsp; Because I can't do another FOR loop for each individual column, I need to either summarize the values of all these columns and if null then delete...or&amp;nbsp;something else?&lt;/P&gt;&lt;P&gt;Here is an example of my table, in this case only the 3rd line of date would qualify to be deleted.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Entity&lt;/TD&gt;&lt;TD&gt;2X_Clean&lt;/TD&gt;&lt;TD&gt;3X_Clean&lt;/TD&gt;&lt;TD&gt;4X_Clean&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is how I would have done it if I could hard code specific columns, except I can't because they vary.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Select Where(Is Missing(:Name( "2X_Clean" ) | :Name( "3X_Clean" ) | :Name( "4X_Clean" )))&amp;lt;&amp;lt;Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any ideas?&amp;nbsp; Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2018 00:54:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51024#M28971</guid>
      <dc:creator>MuttonChops</dc:creator>
      <dc:date>2018-02-10T00:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete rows of variable column numbers when all are missing data</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51029#M28972</link>
      <description>&lt;P&gt;All you have to do is to build a literal string variable that is the dynamic code you need to run to accomplish what you want, and then once built, execute it.&amp;nbsp; The code below is a sample of how you would do it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;theExpr = "dt &amp;lt;&amp;lt; select where(isMissing(Sum(:" || col_list[1];
For( i = 2, i &amp;lt;= N Items( col_list ), i++,
	theExpr = theExpr || ",:" || col_list[i]
);
theExpr = theExpr || "))==1)&amp;lt;&amp;lt;delete Rows;";
Eval( Parse( theExpr ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Feb 2018 01:49:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51029#M28972</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-10T01:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete rows of variable column numbers when all are missing data</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51043#M28982</link>
      <description>&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Jim, this is a interesting topic. When i open the data table, as attached, and run the following jsl, it seems i can not delete the all null row. Why?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;dt&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;=&lt;/SPAN&gt;current datatable&lt;SPAN class="s1"&gt;&lt;STRONG&gt;()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1"&gt;theExpr &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;=&lt;/SPAN&gt; "dt &amp;lt;&amp;lt; select where(isMissing(Sum(:" &lt;SPAN class="s2"&gt;||&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; col_list&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p3"&gt;&lt;SPAN class="s4"&gt;For&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; i &lt;SPAN class="s2"&gt;=&lt;/SPAN&gt; &lt;SPAN class="s3"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s2"&gt;,&lt;/SPAN&gt; i &lt;SPAN class="s2"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN class="s4"&gt;N Items&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; col_list &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN class="s2"&gt;,&lt;/SPAN&gt; i&lt;SPAN class="s2"&gt;++,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p3"&gt;theExpr &lt;SPAN class="s2"&gt;=&lt;/SPAN&gt; theExpr &lt;SPAN class="s2"&gt;||&lt;/SPAN&gt; &lt;SPAN class="s5"&gt;",:"&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;||&lt;/SPAN&gt; col_list&lt;STRONG&gt;[&lt;/STRONG&gt;i&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p3"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1"&gt;theExpr &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;=&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; theExpr &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;||&lt;/SPAN&gt; "))==1)&amp;lt;&amp;lt;delete Rows;"&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p3"&gt;&lt;SPAN class="s4"&gt;Eval&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;SPAN class="s4"&gt;Parse&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; theExpr &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN class="s2"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p3"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Feb 2018 02:49:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51043#M28982</guid>
      <dc:creator>GoodMan</dc:creator>
      <dc:date>2018-02-11T02:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete rows of variable column numbers when all are missing data</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51045#M28984</link>
      <description>&lt;P&gt;This is my fault.&amp;nbsp; I should have realized that a column starting with a number would confuse JMP.&amp;nbsp; I have added in :Name() functions around the references to the column names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

col_list = dt &amp;lt;&amp;lt; get column names( string );
For( i = N Items( col_list ), i &amp;gt; 0, i--,
	If( !Contains( col_list[i], "X_Clean" ),
		Remove From( col_list, i )
	)
);

theExpr = "dt &amp;lt;&amp;lt; select where(isMissing(Sum(:name(\!"" || col_list[1];

For( i = 2, i &amp;lt;= N Items( col_list ), i++, 

	theExpr = theExpr || "\!"),:name(\!"" || col_list[i]

);

theExpr = theExpr || "\!")))==1)&amp;lt;&amp;lt;delete Rows;";

Eval( Parse( theExpr ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 11 Feb 2018 04:36:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51045#M28984</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-11T04:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I delete rows of variable column numbers when all are missing data</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51047#M28986</link>
      <description>&lt;P&gt;Thanks, Jim.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Feb 2018 04:47:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-delete-rows-of-variable-column-numbers-when-all-are/m-p/51047#M28986</guid>
      <dc:creator>GoodMan</dc:creator>
      <dc:date>2018-02-11T04:47:27Z</dc:date>
    </item>
  </channel>
</rss>

