Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
Level II

## Looping to add to an expression

Hello,

I am overall trying to create a loop that will do Process Capability calculations and plots of a data table. The way I have been trying to do this is by building up an expression that contains the process capability. I was thinking an expression because after the loop is done I want to evaluate the process capability one time outside the loop.

Goal ::
-Start a loop
-create an expression that has Process Capability
-for each iteration add to that expression for process capability for another column
-close loop
-evaluate the whole expression with all process capabilities
-Import spec limits from table
-set spec limits as column properties

If there is a better way of doing this please let me know.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User

## Re: Looping to add to an expression

I believe the annotated script below is a better methodology for developing your script

``````Names Default To Here( 1 );

// open your data table, or point to the already open table
dt = Open( "\$SAMPLE_DATA/semiconductor capability.jmp" );
// or
// dt = current data table();

colNamesList = dt << get column names( string, continuous );

// Open your limits table

// Loop across the limits table, and take that information and
// apply it to your measurement data table

// Run the Process Capability code below
Process Capability(
Process Variables( Eval( colNamesList ) ),
Spec Limits Dialog( "No (skip columns with no spec limits)" ),
Goal Plot( 1 ),
Capability Index Plot( 1 ),
Process Performance Plot( 0 )
);``````
Jim
1 REPLY 1
Highlighted
Super User

## Re: Looping to add to an expression

I believe the annotated script below is a better methodology for developing your script

``````Names Default To Here( 1 );

// open your data table, or point to the already open table
dt = Open( "\$SAMPLE_DATA/semiconductor capability.jmp" );
// or
// dt = current data table();

colNamesList = dt << get column names( string, continuous );

// Open your limits table

// Loop across the limits table, and take that information and
// apply it to your measurement data table

// Run the Process Capability code below
Process Capability(
Process Variables( Eval( colNamesList ) ),
Spec Limits Dialog( "No (skip columns with no spec limits)" ),
Goal Plot( 1 ),
Capability Index Plot( 1 ),
Process Performance Plot( 0 )
);``````
Jim
Article Labels

There are no labels assigned to this post.