<?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: Count number of rows in column, with matching character in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/643038#M83977</link>
    <description>&lt;P&gt;Craige,&lt;/P&gt;
&lt;P&gt;Neat solution&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jun 2023 17:12:53 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-06-15T17:12:53Z</dc:date>
    <item>
      <title>Count number of rows in column, with matching character</title>
      <link>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/642983#M83967</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm trying to wirte a jsl code&lt;/SPAN&gt;&amp;nbsp;to get a count of the number of strings(rows) with a certain specified characters at a certain position within the column.&lt;/P&gt;&lt;P&gt;Eg. I want to get the count of the number of the rows containing sting "1" between the rows containing &lt;STRONG&gt;only&amp;nbsp;three "P" characters&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In this case, the row count would be 26.&amp;nbsp;P&lt;SPAN&gt;lease advice.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jackie__0-1686845224672.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/53896i2FE0AD1F61C5C3C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jackie__0-1686845224672.png" alt="Jackie__0-1686845224672.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jackie&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 16:10:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/642983#M83967</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2023-06-15T16:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of rows in column, with matching character</title>
      <link>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/642998#M83969</link>
      <description>&lt;P&gt;Where do you want to store those results? Can there be more or less than 3Ps in row and if there can be, should the calculation for those Ps be ignored?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 16:38:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/642998#M83969</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-06-15T16:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of rows in column, with matching character</title>
      <link>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/643004#M83972</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it can be store in a variable maybe &lt;STRONG&gt;N_rows&amp;nbsp;&lt;/STRONG&gt; something. No, it has to be 3Ps in a row and yes ignore the calculate for other Ps&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 16:43:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/643004#M83972</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2023-06-15T16:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of rows in column, with matching character</title>
      <link>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/643029#M83975</link>
      <description>&lt;P&gt;Here's a pattern matching idea&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "/Z:/data table_sample.jmp" );
// turn the column into a string
txt = Concat Items( dt:column1 &amp;lt;&amp;lt; getvalues, "" );
Pat Match(
	txt,
	"PPP" + Pat Pos() &amp;gt;&amp;gt; pos + Pat Span( "1" ) &amp;gt;&amp;gt; run + "PPP" +
	Pat Test(
		Show( pos + 1, Length( run ) );
		0; // this time the test fails to make it retry the match
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;pos + 1 = 30;&lt;BR /&gt;Length(run) = 26;&lt;BR /&gt;pos + 1 = 88;&lt;BR /&gt;Length(run) = 26;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 17:06:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/643029#M83975</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-06-15T17:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of rows in column, with matching character</title>
      <link>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/643038#M83977</link>
      <description>&lt;P&gt;Craige,&lt;/P&gt;
&lt;P&gt;Neat solution&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 17:12:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/643038#M83977</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-06-15T17:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Count number of rows in column, with matching character</title>
      <link>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/643111#M83978</link>
      <description>&lt;P&gt;Thanks Craige!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2023 17:46:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-number-of-rows-in-column-with-matching-character/m-p/643111#M83978</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2023-06-15T17:46:25Z</dc:date>
    </item>
  </channel>
</rss>

