<?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 can I count the number of batches independently of samples? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-can-I-count-the-number-of-batches-independently-of-samples/m-p/50930#M28933</link>
    <description>&lt;P&gt;Here's a similar approach that uses the Tabulate platform.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Untitled", Add Rows( 10 ),
	New Column( "Year", Numeric, "Ordinal", Format( "Best", 12 ),
		Set Values( [2015, 2015, 2016, 2016, 2016, 2016, 2016, 2017, 2017, 2017] ) ),
	New Column( "Batch", Character( 16 ), "Nominal",
		Set Values( {"A", "A", "B", "C", "C", "C", "C", "D", "E", "E"} ) ),
	New Column( "Sample", Character( 16 ), "Nominal",
		Set Values( {"A1", "A2", "B1", "C1", "C2", "C3", "C4", "D1", "E1", "E2"} ) ),
	New Column( "Value", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [2, 5, 3, 8, 1, 2, 10, 0, 5, 6] ) )
);
dt_tab = (dt &amp;lt;&amp;lt; Tabulate(
	Show Control Panel( 0 ),
	Add Table( Row Table( Grouping Columns( :Year, :Batch ) ) )
)) &amp;lt;&amp;lt; Make Into Data Table;
dt_tab &amp;lt;&amp;lt; Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :Year ), Y( :N ), Overlay( :Batch ) ),
	Elements( Bar( X, Y, Legend( 9 ), Bar Style( "Stacked" ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stacked bargraph.png" style="width: 654px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9253i83C35D55BE2FC575/image-size/large?v=v2&amp;amp;px=999" role="button" title="stacked bargraph.png" alt="stacked bargraph.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Feb 2018 16:21:26 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2018-02-08T16:21:26Z</dc:date>
    <item>
      <title>How can I count the number of batches independently of samples?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-count-the-number-of-batches-independently-of-samples/m-p/50895#M28919</link>
      <description>&lt;P&gt;I have a series of batches produced over a period of years for which a different number of samples have been taken; e.g. see Table below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to graphically visualise the number of batches per year but I cannot seem to be able to do that without having to build a new table in which I remove the repeats; i.e. the samples column. Is there an easy way to count and/or visualise the number of batches per year independently of the number of samples taken?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Year&lt;/TD&gt;&lt;TD&gt;Batch&lt;/TD&gt;&lt;TD&gt;Sample&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2015&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;A1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2015&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;A2&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;B1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;C1&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;C2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;C3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;C4&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;D1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;E1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;E2&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:01:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-count-the-number-of-batches-independently-of-samples/m-p/50895#M28919</guid>
      <dc:creator>ChristopheG</dc:creator>
      <dc:date>2023-06-11T11:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I count the number of batches independently of samples?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-count-the-number-of-batches-independently-of-samples/m-p/50913#M28924</link>
      <description>&lt;P&gt;I am just guessing, but from your statements it sounds like you are used to doing things in Excel.&amp;nbsp; The reason I am saying this, is your hesitation in creating a new data table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"&lt;SPAN&gt;without having to build a new table in which I remove the repeats"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Using JMP, creating new data tables is a very normal process, but typically, one does not manually "remove" rows, but rather one uses one of the many JMP platforms to perform what is needed.&amp;nbsp; In your case, by running the Summary Platform you can accomplish what you want very easily.&amp;nbsp; And if you have thousands of rows of data, the work for you is just as simple as if you have 10s of rows.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To do this, the Summary Platform will need to be run twice.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. Open the data table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. Open&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables==&amp;gt;Summary&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3. Fill in the dialog box to look like:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="summary1.PNG" style="width: 522px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9242iD1D30E901CCAEEC4/image-size/large?v=v2&amp;amp;px=999" role="button" title="summary1.PNG" alt="summary1.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;4. Click on OK and it will produce a new data table that looks like&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="summary2.PNG" style="width: 387px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9244iC1217D128284FE25/image-size/large?v=v2&amp;amp;px=999" role="button" title="summary2.PNG" alt="summary2.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The data in this table contains a count of the count(N Rows) of each different type of batches per year, and you want the number of batches per year.&amp;nbsp; So If you run the Summary Platform on the above new data table,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="summary3.PNG" style="width: 522px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9247i89C310AA684FC9E1/image-size/large?v=v2&amp;amp;px=999" role="button" title="summary3.PNG" alt="summary3.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You will get the following data table, which are the values you want&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="summary4.PNG" style="width: 329px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9248i25E582C173662B5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="summary4.PNG" alt="summary4.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 11:58:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-count-the-number-of-batches-independently-of-samples/m-p/50913#M28924</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-08T11:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I count the number of batches independently of samples?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-count-the-number-of-batches-independently-of-samples/m-p/50915#M28926</link>
      <description>Awesome! Thanks for the help Jim. I will try and move away from my Excel old habits ;)&lt;/img&gt;</description>
      <pubDate>Thu, 08 Feb 2018 13:29:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-count-the-number-of-batches-independently-of-samples/m-p/50915#M28926</guid>
      <dc:creator>ChristopheG</dc:creator>
      <dc:date>2018-02-08T13:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I count the number of batches independently of samples?</title>
      <link>https://community.jmp.com/t5/Discussions/How-can-I-count-the-number-of-batches-independently-of-samples/m-p/50930#M28933</link>
      <description>&lt;P&gt;Here's a similar approach that uses the Tabulate platform.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "Untitled", Add Rows( 10 ),
	New Column( "Year", Numeric, "Ordinal", Format( "Best", 12 ),
		Set Values( [2015, 2015, 2016, 2016, 2016, 2016, 2016, 2017, 2017, 2017] ) ),
	New Column( "Batch", Character( 16 ), "Nominal",
		Set Values( {"A", "A", "B", "C", "C", "C", "C", "D", "E", "E"} ) ),
	New Column( "Sample", Character( 16 ), "Nominal",
		Set Values( {"A1", "A2", "B1", "C1", "C2", "C3", "C4", "D1", "E1", "E2"} ) ),
	New Column( "Value", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [2, 5, 3, 8, 1, 2, 10, 0, 5, 6] ) )
);
dt_tab = (dt &amp;lt;&amp;lt; Tabulate(
	Show Control Panel( 0 ),
	Add Table( Row Table( Grouping Columns( :Year, :Batch ) ) )
)) &amp;lt;&amp;lt; Make Into Data Table;
dt_tab &amp;lt;&amp;lt; Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :Year ), Y( :N ), Overlay( :Batch ) ),
	Elements( Bar( X, Y, Legend( 9 ), Bar Style( "Stacked" ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stacked bargraph.png" style="width: 654px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9253i83C35D55BE2FC575/image-size/large?v=v2&amp;amp;px=999" role="button" title="stacked bargraph.png" alt="stacked bargraph.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2018 16:21:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-can-I-count-the-number-of-batches-independently-of-samples/m-p/50930#M28933</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2018-02-08T16:21:26Z</dc:date>
    </item>
  </channel>
</rss>

