<?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 Sum of Repeat Occurrences By Specified Variable? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11502#M11025</link>
    <description>&lt;P&gt;I get an error.&amp;nbsp; Here's the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Name Unresolved: f{5} in access or evaluation of 'f' , f/*###*/

In the following script, error marked by /*###*/

dt = New Table( "Month-Fruit",

Add Rows( 5 ),

New Column( "Month",

Numeric,

Continuous,

Format( "Best", 12 ),

Set Values( [1, 1, 1, 2, 2] )

),

New Column( "Fruit",

Character,

Nominal,

Set Values( {"ORANGE", "ORANGE", "APPLE", "ORANGE", "APPLE"} )

)

);

dt &amp;lt;&amp;lt; Summarize( f = by( :month, :Fruit ), c = count );

Show( f/*###*/, c );&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;f = {{"1", "1", "2", "2"}, {"APPLE", "ORANGE", "APPLE", "ORANGE"}};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;c = [1, 2, 1, 1];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Oct 2020 19:44:42 GMT</pubDate>
    <dc:creator>jimloughlin</dc:creator>
    <dc:date>2020-10-21T19:44:42Z</dc:date>
    <item>
      <title>Count Sum of Repeat Occurrences By Specified Variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11498#M11021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to create a count sum formula which sums the number of occurrences of a value by a specified column variable.&lt;/P&gt;&lt;P&gt;I want to know by a specified column variable value (i.e. Month) how many times did the same value appear in the column of interest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp; Sum Type of Fruit By Month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New Column ( "Count_Fruit_Mo",&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp; numeric,&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; continuous,&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; // formula or command TBD&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;MONTH&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;FRUIT&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;ORANGE&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;ORANGE&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;APPLE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;ORANGE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;APPLE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// a Summation command appears to function for the entire column, but does not allow specification by another column variable.&lt;/P&gt;&lt;P&gt;// formula( Summation( i = 1, N Row(), :FRUIT&lt;I&gt; == :FRUIT))&lt;/I&gt;&lt;/P&gt;&lt;P&gt;//&amp;nbsp; ORANGE = 3; APPLE = 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm hoping to generate,&lt;/P&gt;&lt;P&gt;:Month = 1;&amp;nbsp; :Fruit = "ORANGE";&amp;nbsp; :Count_Fruit_Mo = 2&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;:Month = 2;&amp;nbsp; :Fruit = "APPLE";&amp;nbsp; :Count_Fruit_Mo = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 14:38:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11498#M11021</guid>
      <dc:creator>aandw</dc:creator>
      <dc:date>2015-03-19T14:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count Sum of Repeat Occurrences By Specified Variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11499#M11022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Consider using the function &lt;EM&gt;Col Number()&lt;/EM&gt; with optional &lt;EM&gt;By-&lt;/EM&gt;arguments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Col Number(Row(), :MONTH, :FRUIT)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 14:51:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11499#M11022</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2015-03-19T14:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Count Sum of Repeat Occurrences By Specified Variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11500#M11023</link>
      <description>&lt;P&gt;You can use the &lt;A href="https://www.jmp.com/support/help/en/15.2/#page/jmp/store-summary-statistics-in-global-variables.shtml" target="_self"&gt;SUMMARIZE&lt;/A&gt; command:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Month-Fruit",
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add Rows( 5 ),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New Column( "Month", Numeric, Continuous,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Format( "Best", 12 ), Set Values( [1, 1, 1, 2, 2] )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; New Column( "Fruit", Character, Nominal,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set Values( {"ORANGE", "ORANGE", "APPLE", "ORANGE", "APPLE"} )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )
);

summarize(f = by(:month, :Fruit), c = count);
show(f, c);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: navy;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;f = {{"1", "1", "2", "2"}, {"APPLE", "ORANGE", "APPLE", "ORANGE"}};
c = [1, 2, 1, 1];&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The way to interpret the output is that there are 4 unique combinations of month and fruit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For month 1, APPLE the count is 1&lt;BR /&gt;For month 1, ORANGE the count is 2&lt;BR /&gt;For month 2, APPLE the count is 1&lt;BR /&gt;For month 2, ORANGE the count is 1&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 19:43:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11500#M11023</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-10-21T19:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count Sum of Repeat Occurrences By Specified Variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11501#M11024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&amp;nbsp; Very helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 15:11:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11501#M11024</guid>
      <dc:creator>aandw</dc:creator>
      <dc:date>2015-03-19T15:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Count Sum of Repeat Occurrences By Specified Variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11502#M11025</link>
      <description>&lt;P&gt;I get an error.&amp;nbsp; Here's the log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Name Unresolved: f{5} in access or evaluation of 'f' , f/*###*/

In the following script, error marked by /*###*/

dt = New Table( "Month-Fruit",

Add Rows( 5 ),

New Column( "Month",

Numeric,

Continuous,

Format( "Best", 12 ),

Set Values( [1, 1, 1, 2, 2] )

),

New Column( "Fruit",

Character,

Nominal,

Set Values( {"ORANGE", "ORANGE", "APPLE", "ORANGE", "APPLE"} )

)

);

dt &amp;lt;&amp;lt; Summarize( f = by( :month, :Fruit ), c = count );

Show( f/*###*/, c );&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;f = {{"1", "1", "2", "2"}, {"APPLE", "ORANGE", "APPLE", "ORANGE"}};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;c = [1, 2, 1, 1];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 19:44:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11502#M11025</guid>
      <dc:creator>jimloughlin</dc:creator>
      <dc:date>2020-10-21T19:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Count Sum of Repeat Occurrences By Specified Variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11503#M11026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry - I removed "dt &amp;lt;&amp;lt;" and it's working.&amp;nbsp; The post has been corrected above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 15:41:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/11503#M11026</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2015-03-20T15:41:22Z</dc:date>
    </item>
    <item>
      <title>Thanks!</title>
      <link>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/324785#M57413</link>
      <description>&lt;P&gt;Thanks MS,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This helped me count up duplicate columns that I know are replicate measurements. It's very fast for a 4000 row table we have. Now I can weight columns appropriately by the amount of replicate measurements are taken.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2020 18:48:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Count-Sum-of-Repeat-Occurrences-By-Specified-Variable/m-p/324785#M57413</guid>
      <dc:creator>lloyd_tripp</dc:creator>
      <dc:date>2020-10-21T18:48:34Z</dc:date>
    </item>
  </channel>
</rss>

