<?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 entries in a single cell in each row? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734621#M91563</link>
    <description>&lt;P&gt;Here's a good way to do that.&amp;nbsp; I use Trim() to eliminate leading whitespace and Starts With() to make sure I don't count entries that just happen to contain "ab" somewhere.&amp;nbsp; Filter Each() requires JMP 16+.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Length( Filter Each( {v, i}, Words( :"Column-to-Count"n, "," ), Starts With( Trim( v ), "ab" ) ) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2024 20:09:36 GMT</pubDate>
    <dc:creator>mmarchandTSI</dc:creator>
    <dc:date>2024-03-13T20:09:36Z</dc:date>
    <item>
      <title>How to count the entries in a single cell in each row?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734402#M91532</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hello All,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Below is the example I am working with. "Column-to-Count" has several entries in each cell within that column. I want to output the count of each cell, which is the "Count" column. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp;&lt;U&gt; Column-to-Count&amp;nbsp;&lt;/U&gt; &amp;nbsp; |&amp;nbsp; &amp;nbsp;&lt;U&gt; Count&lt;/U&gt;&amp;nbsp; &amp;nbsp; |&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp; ab1, tgh9o, pl79s&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp; ab1, fisc8u&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp; ab1, psivb, 7ushg8 |&amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a formula type that I can use to generate the "Count" column? I looked at the "count" formula type and that did not seem to be what I need.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thank You!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 13:30:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734402#M91532</guid>
      <dc:creator>arawlings</dc:creator>
      <dc:date>2024-03-13T13:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the entries in a single cell in each row?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734412#M91533</link>
      <description>&lt;P&gt;Here is the formula&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Length( Words( :"Column-to-Count"n, "," ) )&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2024 13:35:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734412#M91533</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-03-13T13:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the entries in a single cell in each row?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734413#M91534</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Excellent - this works great - thank you!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;follow-up question, what if there are multiple "ab" items and I just want to count those?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp;&lt;U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Column-to-Count&amp;nbsp;&lt;/U&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp;&lt;U&gt;&lt;SPAN&gt;&amp;nbsp; ab&amp;nbsp;&lt;/SPAN&gt;Count&lt;/U&gt;&amp;nbsp; &amp;nbsp; |&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp; ab1, ab2, ab3, tgh9o, pl79s&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp; ab1, fisc8u&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;|&amp;nbsp; &amp;nbsp; ab1, psivb, 7ushg8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I tried to use the formula above with&amp;nbsp;Length( Words( :"Column-to-Count"n, "ab" ) ) and it did not give me the correct count.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 14:03:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734413#M91534</guid>
      <dc:creator>arawlings</dc:creator>
      <dc:date>2024-03-13T14:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the entries in a single cell in each row?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734414#M91535</link>
      <description>&lt;P&gt;Another way&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "Sample table",
	Add Rows( 3 ),
	New Column( "Column-to-count",
		Character,
		Nominal,
		Set Values( {"ab1, tgh9o, pl79s", "ab1, fisc8u", "ab1, psivb, 7ushg8"})
	),
	New Column("Count",
	Numeric,
	Continuous,
	Formula(N Items( Words( :"Column-to-count"n, ", " ) ))
		
	)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2024 13:49:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734414#M91535</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2024-03-13T13:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the entries in a single cell in each row?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734434#M91537</link>
      <description>&lt;P&gt;To count only elements that have "ab", here's a brute force formula&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;alist = Words( :"Column-to-count"n, ", " );
acount = 0;
For( i = 1, i &amp;lt;= N Items( alist ), i++,
	If( Contains( alist[i], "ab" ),
		acount
		++)
);
acount;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Mar 2024 14:16:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734434#M91537</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2024-03-13T14:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the entries in a single cell in each row?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734621#M91563</link>
      <description>&lt;P&gt;Here's a good way to do that.&amp;nbsp; I use Trim() to eliminate leading whitespace and Starts With() to make sure I don't count entries that just happen to contain "ab" somewhere.&amp;nbsp; Filter Each() requires JMP 16+.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Length( Filter Each( {v, i}, Words( :"Column-to-Count"n, "," ), Starts With( Trim( v ), "ab" ) ) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 20:09:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-count-the-entries-in-a-single-cell-in-each-row/m-p/734621#M91563</guid>
      <dc:creator>mmarchandTSI</dc:creator>
      <dc:date>2024-03-13T20:09:36Z</dc:date>
    </item>
  </channel>
</rss>

