cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
ChristopheG
Level I

How can I count the number of batches independently of samples?

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.

 

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?

 

Thanks in advance for the help!

 

YearBatchSampleValue

2015

AA12
2015AA25
2016BB13
2016CC18
2016CC21
2016CC32
2016CC410
2017DD10
2017EE15
2017EE2

6

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How can I count the number of batches independently of samples?

I am just guessing, but from your statements it sounds like you are used to doing things in Excel.  The reason I am saying this, is your hesitation in creating a new data table.

     "without having to build a new table in which I remove the repeats"

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.  In your case, by running the Summary Platform you can accomplish what you want very easily.  And if you have thousands of rows of data, the work for you is just as simple as if you have 10s of rows.

To do this, the Summary Platform will need to be run twice.

1. Open the data table.

2. Open

     Tables==>Summary

3. Fill in the dialog box to look like:

summary1.PNG

4. Click on OK and it will produce a new data table that looks like

summary2.PNG

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.  So If you run the Summary Platform on the above new data table, 

summary3.PNG

 

You will get the following data table, which are the values you want

summary4.PNG

 

 

Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: How can I count the number of batches independently of samples?

I am just guessing, but from your statements it sounds like you are used to doing things in Excel.  The reason I am saying this, is your hesitation in creating a new data table.

     "without having to build a new table in which I remove the repeats"

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.  In your case, by running the Summary Platform you can accomplish what you want very easily.  And if you have thousands of rows of data, the work for you is just as simple as if you have 10s of rows.

To do this, the Summary Platform will need to be run twice.

1. Open the data table.

2. Open

     Tables==>Summary

3. Fill in the dialog box to look like:

summary1.PNG

4. Click on OK and it will produce a new data table that looks like

summary2.PNG

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.  So If you run the Summary Platform on the above new data table, 

summary3.PNG

 

You will get the following data table, which are the values you want

summary4.PNG

 

 

Jim
ChristopheG
Level I

Re: How can I count the number of batches independently of samples?

Awesome! Thanks for the help Jim. I will try and move away from my Excel old habits ;-)
pmroz
Super User

Re: How can I count the number of batches independently of samples?

Here's a similar approach that uses the Tabulate platform.

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 << Tabulate(
	Show Control Panel( 0 ),
	Add Table( Row Table( Grouping Columns( :Year, :Batch ) ) )
)) << Make Into Data Table;
dt_tab << Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :Year ), Y( :N ), Overlay( :Batch ) ),
	Elements( Bar( X, Y, Legend( 9 ), Bar Style( "Stacked" ) ) )
);

stacked bargraph.png