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
Vicki36
Level I

Calculate Cpk for Last 50 results

Hi, is there a simple way to calculate Cpk for only a selected number of the most recent rows by using scripts. I am looking at machine capability and although the overall Cpk is a very useful metric to identify overall process capability, once improvements have been made to the manufacturing process, I want a way to easily track if the process is improving by only looking at the Cpk for the last 50 results. I currently have a script which automatically calculates the Cpk and other metrics by performing the 'Process Screening' and saving it to a summary table. If possible I want to be able to have the overall Cpk and Cpk of the last 50 components in 2 columns next to each other in the same data table. Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Calculate Cpk for Last 50 results

Here is a simple script that can be used to get the Cp/Cpk for the last 50 rows in your data table.  It generates the same table that your Process Screening generated, but this time, with just the 2 variables you want, and just for the last 50 rows of data.

ps.PNG

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
dt << select where( Row() < N Rows( dt ) - 50 );
dt << hide and exclude;


ps = dt << Process Screening( Y( :NPN1, :PNP1 ), Control Chart Type( "Indiv and MR" ) );
newdt = ps << get data table;

dt << clear rowstates;
Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Calculate Cpk for Last 50 results

Here is a simple script that can be used to get the Cp/Cpk for the last 50 rows in your data table.  It generates the same table that your Process Screening generated, but this time, with just the 2 variables you want, and just for the last 50 rows of data.

ps.PNG

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
dt << select where( Row() < N Rows( dt ) - 50 );
dt << hide and exclude;


ps = dt << Process Screening( Y( :NPN1, :PNP1 ), Control Chart Type( "Indiv and MR" ) );
newdt = ps << get data table;

dt << clear rowstates;
Jim
Vicki36
Level I

Re: Calculate Cpk for Last 50 results

Thank you that works really well!

 

I've got about 50 columns of data which I am calculating Cpk values for and I'm wondering if there is an easy way to select these columns without having to hard code the column names when computing the Process Screening as you have done in the example with NPN1 and PNP1. I want to do something like the following to get the column names but it doesn't work in it's current state:

 

cNames = dt << Get Column Names( Numeric, "Continuous" );
scr = dt << Process Screening( Y( cNames ), Control Chart Type( "Indiv and MR" ) );
txnelson
Super User

Re: Calculate Cpk for Last 50 results

Here is the solution.....

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

cNames = dt << Get Column Names(Numeric, "Continuous");
// shorten list for illustration purposes
remove from( cNames, 3, 128);

dt << select where( Row() < N Rows( dt ) - 50 );
dt << hide and exclude;


ps = dt << Process Screening( Y( eval(cNames) ), Control Chart Type( "Indiv and MR" ) );
newdt = ps << get data table;

dt << clear rowstates;

Your experiences with JSL will be greatly enhanced if you take the time to read the Scripting Guide.

Jim