<?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 How do I count number of non-blank rows across specific rows? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-count-number-of-non-blank-rows-across-specific-rows/m-p/781042#M96355</link>
    <description>&lt;P&gt;I have the table displayed here and would like to make a new column that contains "N" which is the number of columns that have numbers but only for the columns labelled "DecodeCount_BW**". For example for the first row, it should return "5", for the second row it should return "2", etc&lt;/P&gt;&lt;P&gt;In Excel I do this with "counta", but trying to learn JMP for improved statistical analysis, but I've getting stuck at simple things like this maybe due to my excel-formatted brain... Sorry if this is super basic but I can't find a formula on the list of formulas that does this..&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;JMP17 user&lt;/P&gt;</description>
    <pubDate>Mon, 12 Aug 2024 16:51:29 GMT</pubDate>
    <dc:creator>ConfusedUser123</dc:creator>
    <dc:date>2024-08-12T16:51:29Z</dc:date>
    <item>
      <title>How do I count number of non-blank rows across specific rows?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-count-number-of-non-blank-rows-across-specific-rows/m-p/781042#M96355</link>
      <description>&lt;P&gt;I have the table displayed here and would like to make a new column that contains "N" which is the number of columns that have numbers but only for the columns labelled "DecodeCount_BW**". For example for the first row, it should return "5", for the second row it should return "2", etc&lt;/P&gt;&lt;P&gt;In Excel I do this with "counta", but trying to learn JMP for improved statistical analysis, but I've getting stuck at simple things like this maybe due to my excel-formatted brain... Sorry if this is super basic but I can't find a formula on the list of formulas that does this..&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;JMP17 user&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 16:51:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-count-number-of-non-blank-rows-across-specific-rows/m-p/781042#M96355</guid>
      <dc:creator>ConfusedUser123</dc:creator>
      <dc:date>2024-08-12T16:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I count number of non-blank rows across specific rows?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-count-number-of-non-blank-rows-across-specific-rows/m-p/781079#M96357</link>
      <description>&lt;P&gt;Formulas generally do not work in this direction that easily (calculating something by row instead of column). Depending what you are doing stacking your data first might be beneficial.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use formula for that (it might be a bit finicky), but generally I would use scripting. Below is one example&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1723483606619.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/67065iC98BBC30F59E15BC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1723483606619.png" alt="jthi_0-1723483606619.png" /&gt;&lt;/span&gt;&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 3",
	Add Rows(3),
	Compress File When Saved(1),
	New Column("Column 1", Numeric, "Continuous", Format("Best", 12), Set Values([., ., .])),
	New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([., ., .])),
	New Column("AB1", Numeric, "Continuous", Format("Best", 12), Set Values([2, ., .])),
	New Column("AB2", Numeric, "Continuous", Format("Best", 12), Set Values([., 2, 1])),
	New Column("AB3", Numeric, "Continuous", Format("Best", 12), Set Values([., 5, .]))
);

dt &amp;lt;&amp;lt; New Column("N", Numeric, Continuous);

cols_of_interest = Filter Each({colname}, dt &amp;lt;&amp;lt; Get Column Names("String"),
	Starts With(colname, "AB");
);

For Each Row(Current Data Table(),
	:N = Sum(!Is Missing(dt[Row(), cols_of_interest]));
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and if you really want to use formula you might be able to use something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;As Constant(cols_of_interest = Filter Each({colname}, Current Data Table() &amp;lt;&amp;lt; Get Column Names("String"),
	Starts With(colname, "AB");
));
Sum(!Is Missing(dt[Row(), cols_of_interest]));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You have to figure your own comparison to filter down to columns of interest (Starts With should work for your data also)&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 17:27:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-count-number-of-non-blank-rows-across-specific-rows/m-p/781079#M96357</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-08-12T17:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I count number of non-blank rows across specific rows?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-count-number-of-non-blank-rows-across-specific-rows/m-p/781081#M96358</link>
      <description>&lt;P&gt;Tables/Summary can count for you. To make it count over multiple columns, you have to fist stack the data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "test",
	Add Rows( 6 ),
	New Column( "W8",Set Values( [2, 5, ., 5, ., 6] )),
	New Column( "W9",Set Values( [2, ., 3, 3, 1, 2] )),
	New Column( "W1",Set Values( [2, ., ., ., ., .] )),
	New Column( "W2",Set Values( [3, ., ., ., ., .] )),
	New Column( "W3",Set Values( [3, ., ., ., ., .] )),
	New Column( "W4",Set Values( [., ., 4, ., 2, .] )),
	New Column( "W5",Set Values( [., 2, ., ., ., .] )),
	New Column( "W6",Set Values( [., ., 5, ., 3, .] )));

dt &amp;lt;&amp;lt; New Column( "row",Formula( Row() ));
dtstack =dt &amp;lt;&amp;lt; Stack(	columns( :W8, :W9, :W1, :W2, :W3, :W4, :W5, :W6 ),"Non-stacked columns"n( Keep( :row ) ));
dtstack &amp;lt;&amp;lt; Summary(	Group( :row ),	N( :Data )	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;btw:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;"Non-stacked columns"n&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;a named argument which needs to be written as&amp;nbsp; &lt;FONT face="courier new,courier"&gt;"..."n&lt;/FONT&gt;. Argh!&lt;/P&gt;&lt;P&gt;How good that enhanced log knows these details ...&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 17:52:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-count-number-of-non-blank-rows-across-specific-rows/m-p/781081#M96358</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-08-12T17:52:27Z</dc:date>
    </item>
  </channel>
</rss>

