<?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: Counting rows based on multi condition match in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214145#M42812</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14945"&gt;@Sciguy_1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe I understand what you're asking, but let me reiterate back to make sure. You'd like a new column that has a count of the number of unique combinations, regardless of how many times those combinations occurred? In the subset you provided, there are 3 unique combinations of the three columns, and as you pointed out, one of the combinations occurred 4 times, another 3 times, and another 2 times. Another way to say this is how many unique rows do you have, as defined by the first three columns. If this is indeed what you're after, the following column formula will do, which essentially counts up the number of times a 1 occurs in the "Count In Groups" Columns, i.e., the number of unique groups:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;As Constant(
	uniqueRowCount = Summation(
		i = 1,
		N Row(),
		If( :Count In Groups[i] == 1,
			1,
			0
		)
	)
);
uniqueRowCount;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="unique.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/17855i4FB9B75A7C37015D/image-size/large?v=v2&amp;amp;px=999" role="button" title="unique.png" alt="unique.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've attached the new table here as well. Is this what you were looking to do?&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2019 19:26:36 GMT</pubDate>
    <dc:creator>jules</dc:creator>
    <dc:date>2019-06-21T19:26:36Z</dc:date>
    <item>
      <title>Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/213943#M42778</link>
      <description>&lt;P&gt;I&amp;nbsp;want to count rows in my dataset if&amp;nbsp;3 columns (A-B-C)&amp;nbsp;match. I want to enter the value in a new column (D). Here is an example. Thank you for your assistance!&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Column A&lt;/TD&gt;&lt;TD&gt;Column B&lt;/TD&gt;&lt;TD&gt;Column C&lt;/TD&gt;&lt;TD&gt;Column D (Counted Tally)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;Z&lt;/TD&gt;&lt;TD&gt;S&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;Z&lt;/TD&gt;&lt;TD&gt;S&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;P&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;P&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;P&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;Z&lt;/TD&gt;&lt;TD&gt;S&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;M&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;M&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;Z&lt;/TD&gt;&lt;TD&gt;S&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 17:06:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/213943#M42778</guid>
      <dc:creator>Sciguy_1</dc:creator>
      <dc:date>2019-06-20T17:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/213963#M42782</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14945"&gt;@Sciguy_1&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;There are a few ways you could go about this. I think a formula column approach is relatively straightforward, with two columns, first, one that counts the occurrences of a match incrementally, and then a second column that finds the max value of that count by group, which is what you're calling a counted tally here. Here's what that table looks like:&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2019-06-20 at 1.34.14 PM.png" style="width: 771px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/17836iFF9DA94AC9643100/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-06-20 at 1.34.14 PM.png" alt="Screen Shot 2019-06-20 at 1.34.14 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here are the column formulas:&lt;/P&gt;
&lt;P&gt;Counting in groups by the columns used for a match:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Cumulative Sum( 1, :Column A, :Column B, :Column C )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and the Max of that count column, also grouped by the columns used for a match&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Maximum( :Count In Groups, :Column A, :Column B, :Column C )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Table is attached for your reference.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, if you wish to create a table that lists unique rows only once, with the number of times they matched, you can use Tables &amp;gt; Summary. Enter in your columns as Group, and hit okay. Here's what that setup looks like:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2019-06-20 at 1.39.37 PM.png" style="width: 823px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/17837i31D6D3D7E0B166F5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-06-20 at 1.39.37 PM.png" alt="Screen Shot 2019-06-20 at 1.39.37 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;This will return a summary table that shows the unique combinations of values in those three columns, along with a column showing the number of occurrences in the data table. &lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2019-06-20 at 1.42.23 PM.png" style="width: 690px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/17838i5AA49FD39032D116/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-06-20 at 1.42.23 PM.png" alt="Screen Shot 2019-06-20 at 1.42.23 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Once you have this table, you can select, and then drag the N Rows column from the summary table directly into your original table, and JMP will handle all the Matching for you to update the original table with those values. Here's what that looks like:&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="drag.gif" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/17841i3F55FCEBDFA50B45/image-size/large?v=v2&amp;amp;px=999" role="button" title="drag.gif" alt="drag.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, the script for making the table is also saved as a Source script to the summary table:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "Example.jmp" ) &amp;lt;&amp;lt; Summary(
	Group( :Column A, :Column B, :Column C ),
	Freq( "None" ), Weight( "None" )
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2019 17:47:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/213963#M42782</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2019-06-20T17:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214072#M42799</link>
      <description>Thank you Julian the column approach addresses my application perfectly.</description>
      <pubDate>Fri, 21 Jun 2019 15:54:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214072#M42799</guid>
      <dc:creator>Sciguy_1</dc:creator>
      <dc:date>2019-06-21T15:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214142#M42810</link>
      <description>&lt;P&gt;To go one step further- Lets say I wanted to add another column that showed the number of times a combination occurred within a subset. So in the example, in the "total in group" column there are 4-"4", 3-"3", and 2-"2". If all the rows (1 thru 9) represented the entire subset, the answer in this case would be 3 because a "4" occurred, a "3" occurred, and a "2" occurred. So in the new column "total in subset" every row would have a 3. I cant figure out how to get figures summed in that manner.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 19:06:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214142#M42810</guid>
      <dc:creator>Sciguy_1</dc:creator>
      <dc:date>2019-06-21T19:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214143#M42811</link>
      <description>&lt;P&gt;create a new column and use the following formula for the new column&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;summarize(byGroup=by(:Total in Group));
n items(byGroup)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Jun 2019 19:24:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214143#M42811</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-06-21T19:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214145#M42812</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14945"&gt;@Sciguy_1&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe I understand what you're asking, but let me reiterate back to make sure. You'd like a new column that has a count of the number of unique combinations, regardless of how many times those combinations occurred? In the subset you provided, there are 3 unique combinations of the three columns, and as you pointed out, one of the combinations occurred 4 times, another 3 times, and another 2 times. Another way to say this is how many unique rows do you have, as defined by the first three columns. If this is indeed what you're after, the following column formula will do, which essentially counts up the number of times a 1 occurs in the "Count In Groups" Columns, i.e., the number of unique groups:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;As Constant(
	uniqueRowCount = Summation(
		i = 1,
		N Row(),
		If( :Count In Groups[i] == 1,
			1,
			0
		)
	)
);
uniqueRowCount;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="unique.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/17855i4FB9B75A7C37015D/image-size/large?v=v2&amp;amp;px=999" role="button" title="unique.png" alt="unique.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've attached the new table here as well. Is this what you were looking to do?&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 19:26:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214145#M42812</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2019-06-21T19:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214149#M42816</link>
      <description>&lt;P&gt;That is exactly what I am wanting to do, you explained it quite well. But upon applying the formula I am not getting the correct values. Let me supply a new example just to make sure we are on the same wavelength. This is a very large and quite dynamic data set. Hope this better explains and does not confuse the issue. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;TUBE&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;JAR&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;BUCKET&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;SOG&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&lt;STRONG&gt;No. Times Tube occurs per JAR X BUCKET X SOG&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;No. unique times Jar occurs per bucket X SOG combination&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ASX&lt;/TD&gt;&lt;TD&gt;ABE&lt;/TD&gt;&lt;TD&gt;WDNH&lt;/TD&gt;&lt;TD&gt;5001&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CDV&lt;/TD&gt;&lt;TD&gt;ABE&lt;/TD&gt;&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5008&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;TRE&lt;/TD&gt;&lt;TD&gt;ABE&lt;/TD&gt;&lt;TD&gt;SDER&lt;/TD&gt;&lt;TD&gt;5008&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NFE&lt;/TD&gt;&lt;TD&gt;ABE&lt;/TD&gt;&lt;TD&gt;SDER&lt;/TD&gt;&lt;TD&gt;5008&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 21 Jun 2019 20:40:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214149#M42816</guid>
      <dc:creator>Sciguy_1</dc:creator>
      <dc:date>2019-06-21T20:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214152#M42818</link>
      <description>&lt;P&gt;It appears that every row in your table is unique, so I would expect "No. Times Tube occurs per JAR X BUCKET X SOG" to be 1 for the entire table. Am I misunderstanding this format?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also - attaching your JMP data table, or a subset of it, with your column formulas intact will be much more helpful to diagnose what is happening, rather than pasting the table into the body of the message.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 20:51:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214152#M42818</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2019-06-21T20:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214360#M42859</link>
      <description>&lt;P&gt;You are correct, every row is unique. Here is a subset of the real dataset. I created a couple columns representing what I am trying to accompolish. The column 'number of times BUCKET appears per SOG' I manually populated.The NULL value can be treated as its own BUCKET. The second column needs to show the number of times J1 appears per: SOG X BUCKET combination. Hope this makes things easier thank you for your assistance.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 16:55:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214360#M42859</guid>
      <dc:creator>Sciguy_1</dc:creator>
      <dc:date>2019-06-24T16:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214361#M42860</link>
      <description>&lt;P&gt;You are correct, every row is unique. Here is a subset of the real dataset. I created a couple columns representing what I am trying to accompolish. The column 'number of times BUCKET appears per SOG' I manually populated.The NULL value can be treated as its own BUCKET. The second column needs to show the number of times J1 appears per: SOG X BUCKET combination. Hope this makes things easier thank you for your assistance.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 16:55:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214361#M42860</guid>
      <dc:creator>Sciguy_1</dc:creator>
      <dc:date>2019-06-24T16:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214377#M42867</link>
      <description>I see I made an error. The header on the last column jar_id equals column J1. Would also like to know the number of times T1 occurs per J1 X SOG X BUCKET combination. Thank you.</description>
      <pubDate>Mon, 24 Jun 2019 17:20:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214377#M42867</guid>
      <dc:creator>Sciguy_1</dc:creator>
      <dc:date>2019-06-24T17:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214889#M42969</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14945"&gt;@Sciguy_1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a table that accomplishes what I think you're after, using the formulas I showed before but adapted for each combination. My calculation for "# times BUCKET appears per: SOG (Correct Answer)" does not match the one you said you manually created, but I am pretty sure what I've done here is correct since it squares with my own manual counting. Can you check and confirm I am not missing something though?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll notice that you need a &lt;STRONG&gt;pair of columns&lt;/STRONG&gt; for each of these counts, one that counts incrementally in each grouping, and another that finds the total. I've hidden the incremental count columns in the table, but note that you must have these. You can generalize this to really any number of combinations, you're just adjusting the formulas as shown below to include the right columns as your by groups:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2019-06-26 at 5.20.49 PM.png" style="width: 374px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18030i629C729C275487D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-06-26 at 5.20.49 PM.png" alt="Screen Shot 2019-06-26 at 5.20.49 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2019-06-26 at 5.20.54 PM.png" style="width: 536px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18031i3CBC6C15082459EE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-06-26 at 5.20.54 PM.png" alt="Screen Shot 2019-06-26 at 5.20.54 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this gets your further along,&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 21:22:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214889#M42969</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2019-06-26T21:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214909#M42971</link>
      <description>&lt;P&gt;An alternative to using two columns to arrive at the counts would be to count the rows of each combination with the ColNumber() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Number(Row(), :J1, :SOG, :BUCKET);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 01:03:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/214909#M42971</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-06-27T01:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/215001#M42987</link>
      <description>&lt;P&gt;I am still having issues getting this to work. The 2 equation version Julian suggested- the first equation is giving me all 1's so not sure what I am doing incorrectly. The single equation method does give me the total number of times a particular bucket appears per SOG. The other part I am still trying to get is the number of times I have to grab a bucket. For example if I grab a bucket and take 4 samples or grab it again and take 19 samples- in each case I only grabbed the bucket once. From my data example EXULU appears a total of 4 times in the 621 SOG. I am wanting to create a tally that would count those 4 times as 1 time. EH8QK appears a total of 19 times in the 621 SOG but I want to count those all as 1 as well. I hope this better explains the second half of the problem. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 13:29:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/215001#M42987</guid>
      <dc:creator>Sciguy_1</dc:creator>
      <dc:date>2019-06-27T13:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Counting rows based on multi condition match</title>
      <link>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/215372#M43039</link>
      <description>&lt;P&gt;I'm glad the formula&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/182"&gt;@ms&lt;/a&gt;&amp;nbsp;posted works for you! I'm curious why mine is failing on your actual table, but perhaps our time is better spent on your other question rather than diagnosing what went wrong with my inferior two-column method!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can I ask what problem creating that tally is solving? It seems as though you'll just end up with a column of 1s by doing this, since matter the number of occurrences of the pattern you're counting it as 1. I don't think I'm fully grasping what you're wanting to do or what it's helping you accomplish. I think if I knew the end goal I might be able to suggest a simpler overall method than a series of formula columns.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 16:10:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Counting-rows-based-on-multi-condition-match/m-p/215372#M43039</guid>
      <dc:creator>jules</dc:creator>
      <dc:date>2019-06-28T16:10:18Z</dc:date>
    </item>
  </channel>
</rss>

