<?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 to count the number of columns in each row of data that fall below a certain value in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/372957#M62285</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/16121"&gt;@fionaweston&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; As mentioned, here is the data table mock-up I did with the Counts script. It will only count numeric/continuous columns and ignore any other data/modeling type columns in your table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
    <pubDate>Wed, 31 Mar 2021 12:41:00 GMT</pubDate>
    <dc:creator>SDF1</dc:creator>
    <dc:date>2021-03-31T12:41:00Z</dc:date>
    <item>
      <title>how to count the number of columns in each row of data that fall below a certain value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371440#M62136</link>
      <description>&lt;P&gt;If I have 4 columns in my table and I need to find out per row how many columns fall below 98% how can I write a simple formula to do this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are some similar post but they are way more complicated than I need.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:27:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371440#M62136</guid>
      <dc:creator>fionaweston</dc:creator>
      <dc:date>2023-06-10T23:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of columns in each row of data that fall below a certain value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371449#M62137</link>
      <description>This is just a short version. The real table could have 100+ columns.</description>
      <pubDate>Thu, 25 Mar 2021 16:47:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371449#M62137</guid>
      <dc:creator>fionaweston</dc:creator>
      <dc:date>2021-03-25T16:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of columns in each row of data that fall below a certain value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371475#M62141</link>
      <description>&lt;P&gt;Probably this formula could do:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;test = Function( {val},
	If( val &amp;lt; 0.98, 1, 0 )
);
Sum( test( :A ), test( :B ), test( :C ), test( :D ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Georg_0-1616691742674.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31559iBE0DD4974644B543/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Georg_0-1616691742674.png" alt="Georg_0-1616691742674.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 17:03:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371475#M62141</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2021-03-25T17:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of columns in each row of data that fall below a certain value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371476#M62142</link>
      <description>&lt;P&gt;Thanks Georg, that works!&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 17:09:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371476#M62142</guid>
      <dc:creator>fionaweston</dc:creator>
      <dc:date>2021-03-25T17:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of columns in each row of data that fall below a certain value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371481#M62144</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/16121"&gt;@fionaweston&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; To expand and generalize what&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/9474"&gt;@Georg&lt;/a&gt;&amp;nbsp;posted, this script you can save to any data table and it will generate a new column with the counts. I wanted to add this because you mentioned that the data table could have hundreds of columns, and this can handle that, as well as however many rows you have.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dt &amp;lt;&amp;lt; New Column( "Counts", Numeric, Continuous );

test = Function( {val},
	If( val &amp;lt; 0.98, 1, 0 )
);

For( r = 1, r &amp;lt;= N Rows(), r++,
	count = 0;
	ret = 0;
	For( col = 1, col &amp;lt;= N Col() - 1, col++, 
		If( Is Missing( Column( col )[r] ) == 1,
			count = 0,
			count = test( Column( col )[r] )
		);
		ret += count;
		:Counts[r] = ret;
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; You just click the hot button next to your data table name and select New Script, then copy/paste the script from above into the new script (and give it a name of course) and then click the green arrow to run it. You can then copy/paste that script into any data table -- of course, you would change the comparison value in the "test" function for whatever data set your using.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE: I noticed my original post didn't account for missing values in a column and corrected it to account for missing values.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 17:51:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371481#M62144</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2021-03-25T17:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of columns in each row of data that fall below a certain value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371570#M62152</link>
      <description>Thanks Diedrich,&lt;BR /&gt;This is awesome!</description>
      <pubDate>Thu, 25 Mar 2021 22:43:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371570#M62152</guid>
      <dc:creator>fionaweston</dc:creator>
      <dc:date>2021-03-25T22:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of columns in each row of data that fall below a certain value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371655#M62158</link>
      <description>Glad to hear it works for you!</description>
      <pubDate>Fri, 26 Mar 2021 12:19:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/371655#M62158</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2021-03-26T12:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of columns in each row of data that fall below a certain value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/372957#M62285</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/16121"&gt;@fionaweston&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; As mentioned, here is the data table mock-up I did with the Counts script. It will only count numeric/continuous columns and ignore any other data/modeling type columns in your table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!,&lt;/P&gt;&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 12:41:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/372957#M62285</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2021-03-31T12:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to count the number of columns in each row of data that fall below a certain value</title>
      <link>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/373081#M62295</link>
      <description>&lt;P&gt;That helps enormously Diedrich.&lt;/P&gt;&lt;P&gt;Thankyou&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 17:30:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-to-count-the-number-of-columns-in-each-row-of-data-that-fall/m-p/373081#M62295</guid>
      <dc:creator>fionaweston</dc:creator>
      <dc:date>2021-03-31T17:30:49Z</dc:date>
    </item>
  </channel>
</rss>

