<?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 Delete all columns that have zeros in all raws in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217011#M43371</link>
    <description>&lt;P&gt;Well, that is what I need to do.&lt;/P&gt;&lt;P&gt;I tried to look for similar scripts but I have not found the solution.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Manel&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 20:13:56 GMT</pubDate>
    <dc:creator>gallardet</dc:creator>
    <dc:date>2019-07-10T20:13:56Z</dc:date>
    <item>
      <title>Delete all columns that have zeros in all raws</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217011#M43371</link>
      <description>&lt;P&gt;Well, that is what I need to do.&lt;/P&gt;&lt;P&gt;I tried to look for similar scripts but I have not found the solution.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Manel&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 20:13:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217011#M43371</guid>
      <dc:creator>gallardet</dc:creator>
      <dc:date>2019-07-10T20:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all columns that have zeros in all raws</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217045#M43377</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14686"&gt;@gallardet&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for starters try this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Select-and-Delete-a-Column-Where-All-Rows-Have-The-Same-Value/m-p/62142/highlight/true#M33477" target="_self"&gt;https://community.jmp.com/t5/Discussions/Select-and-Delete-a-Column-Where-All-Rows-Have-The-Same-Value/m-p/62142/highlight/true#M33477&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ron&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 21:43:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217045#M43377</guid>
      <dc:creator>ron_horne</dc:creator>
      <dc:date>2019-07-10T21:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all columns that have zeros in all raws</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217046#M43378</link>
      <description>&lt;P&gt;Here is a simple script that will delete all columns that are all zeros&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

numericColNames = dt &amp;lt;&amp;lt; get column names( string, numeric );

allZerosList = {};

For( i = 1, i &amp;lt;= N Items( numericColNames ), i++,
	If( Col Sum( Column( dt, numericColNames[i] ) ) == 0
	&amp;amp; Col Std Dev( Column( dt, numericColNames[i] ) ) == 0,
		Insert Into( allZerosList, numericColNames[i] )
	)
);

If( N Items( allZerosList ) &amp;gt; 0,
	dt &amp;lt;&amp;lt; delete columns( allZerosList )
); &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Jul 2019 21:52:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217046#M43378</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-07-10T21:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all columns that have zeros in all raws</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217168#M43410</link>
      <description>Thanks, Sir.</description>
      <pubDate>Thu, 11 Jul 2019 18:55:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217168#M43410</guid>
      <dc:creator>gallardet</dc:creator>
      <dc:date>2019-07-11T18:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all columns that have zeros in all raws</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217992#M43579</link>
      <description>Can this be tweaked such that I can remove columns that have mostly zeros (eg. 50% of more of the rows)?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 18 Jul 2019 18:15:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/217992#M43579</guid>
      <dc:creator>TRR21</dc:creator>
      <dc:date>2019-07-18T18:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Delete all columns that have zeros in all raws</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/218075#M43602</link>
      <description>&lt;P&gt;You could do something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(
	N Rows( dt &amp;lt;&amp;lt; get rows where( Column( dt, numericColNames[i] ) == 0 ) ) &amp;gt;
	N Rows( dt ) / 2,
	Insert Into( allZerosList, numericColNames[i] )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Jul 2019 01:32:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-all-columns-that-have-zeros-in-all-raws/m-p/218075#M43602</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-07-19T01:32:22Z</dc:date>
    </item>
  </channel>
</rss>

