cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
illinitom
Level II

Show as graph reference lines

I'm importing spec limits with a script to every datatable that I want to graph.  While distributions show specs, box plots do not.  I've been trying to insert the "Show Spec Limits(1) in multiple areas, but with no success.  I am a JSL noob, so looking for some expertise.  Going through each column properties GUI to check the box is unmanageable.  Here is a snippet of code;

dt = open("datatable.jmp");

obj = Capability(

  Y(  :spec1, :spec2, :spec3, :spec4 ),

Spec Limits( Import Spec Limits("spec_limits_table.jmp")));

obj << Show Limits(1);

obj << Save Spec Limits as Column Properties;

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Show as graph reference lines

I ran your included script, and found that the Capability Platform does create what I believe are incorrectly structured spec limit column properties.  I have sent this off to JMP for their response.

All that given, what has to change, is the method for extracting the current spec limits, given your current structure.  The new structure is not a List,

Here is the reworked script that I believe will work with your data.  Remember, once the Show Limits value is set, JMP will change the structure of the spec limit property, so future "get property("spec limits")" will return the spec limits as a list, not the strange structure assigned by the Capability Platform.

Names Default To Here( 1 );

dt=current data table();

// Get all of the numeric columns in the data table

Numeric Columns = dt << get column names( numeric, string );

// Loop across all of the columns and set the Show Limits

For( i = 3, i <= N Items( Numeric Columns ), i++,

       // If the request to get the spec limits returns an empty value the

       // column does not have spec limits, so don't set Show Limits

       If( Is Empty( Column( dt, Numeric Columns ) << get property( "spec limits" ) ) == 0,

              // This is the structure of the spec limits list. If you only set the

              // Show Limits, it will wipe out the other limits, so they need to be

              // retrieved and substituted into the structure

              speclimitvals = Char( column(dt,Numeric Columns) << get property( "spec limits" ) );

              LSL = Try( Num( Word( 2, Substr( speclimitvals, Contains( speclimitvals, "LSL(" ) ), "()" ) ), . );

              USL = Try( Num( Word( 2, Substr( speclimitvals, Contains( speclimitvals, "USL(" ) ), "()" ) ), . );

              Target = Try( Num( Word( 2, Substr( speclimitvals, Contains( speclimitvals, "Target(" ) ), "()" ) ), . );

              Eval(

                     Substitute(

                                  Expr(

                                         Column( dt, __col__ ) << Set Property(

                                                "Spec Limits",

                           {LSL( __LSL__ ), USL( __USL__ ), Target( __Target__ ), Show Limits( 1 )}

                           )

                    ),

                           Expr( __col__ ), Numeric Columns,

                           Expr( __LSL__ ), LSL,

                            Expr( __USL__ ), USL,

                           Expr( __Target__ ), Target

                     )

              );

       )

);

Jim

View solution in original post

9 REPLIES 9
txnelson
Super User

Re: Show as graph reference lines

Here is a script that will set the Show Limits for all numeric columns in the data table, if the column has spec limits.

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );

// Get all of the numeric columns in the data table

Numeric Columns = dt << get column names( numeric, string );

// Loop across all of the columns and set the Show Limits

For( i = 3, i <= N Items( Numeric Columns ), i++,

       // If the request to get the spec limits returns an empty value the

       // column does not have spec limits, so don't set Show Limits

       If( Is Empty( Column( dt, Numeric Columns[i] ) ) == 0,

              // This is the structure of the spec limits list. If you only set the

              // Show Limits, it will wipe out the other limits, so they need to be

              // retrieved and substituted into the structure

              Eval(

                     Substitute(

                                  Expr(

                                         Column( dt, __col__ ) << Set Property(

                                                "Spec Limits",

                                                {LSL( __LSL__ ), USL( __USL__ ), Target( __Target__ ), Show Limits( 1 )}

                                         )

                                  ),

                           Expr( __col__ ), Numeric Columns[i],

                           Expr( __LSL__ ), Try( (Column( dt, Numeric Columns[i] ) << get property( "Spec Limits" ))["LSL"], . ),

                           Expr( __USL__ ), Try( (Column( dt, Numeric Columns[i] ) << get property( "Spec Limits" ))["USL"], . ),

                           Expr( __Target__ ), Try( (Column( dt, Numeric Columns[i] ) << get property( "Spec Limits" ))["Target"], . )

                     )

              )

       )

);

Jim
illinitom
Level II

Re: Show as graph reference lines

For some reason the get column names(numeric, string) eliminates my spec limits.  If I change to get column names(numeric), the limits remain, but the Show Spec box is not checked.

txnelson
Super User

Re: Show as graph reference lines

What release of JMP are you using?

Are the comments you are stating, based upon running the code, without change,  I had included in my response, or are the comments based upon running that code against your data table?

Can you attach the data table you are using?

Jim
illinitom
Level II

Re: Show as graph reference lines

JMP 12.2

I ran your code swapping out the dt --> Open file only.  Basically running your code against my data.

txnelson
Super User

Re: Show as graph reference lines

First off, there is a small error in the code I posted.  The line:

     If( Is Empty( Column( dt, Numeric Columns[i] ) ) == 0,

should actually be:

    If( Is Empty( Column( dt, Numeric Columns[i] )<< get property("spec limits") ) == 0,

but that isn't the reason that the script eliminates the spec limits.


The reason for that issue, is that whatever method you are using to populate the limits in the original data table, the limits have been incorrectly specified.  Even though they seem to work in the Distribution, etc. platforms, the actual spec limit specification was done wrong.


When the spec limit property is extracted from the data table you attached to your last response, the following is what is returned:

     Spec Limits( LSL( 1 ), USL( 1.6 ), Target( 1.3 ) )

What should be returned is:

     {LSL( 1 ), USL( 1.6 ), Target( 1.3 )}

If you manually go into the spec limits for the Met1_Res/um column, and set the "show limits" checkbox, the limit list is changed to the proper structure.


If you take the original code that I included, and run it against the Semiconductor Capability data table, as it is set to run against, you will see that it sets the "Show Limits" value.  If you change to the correct spec limits structure in your sample data table, it will work too.


Of course a script could be written to read the structure that is in the original data table, and the structure will then be changed automatically to the correct structure, when the show limits value it replaced, along with the limits.  But I would advise against this, but to rather figure out and correct the pgm that is incorrectly specifying the incorrect limits stucture.

     

Jim
illinitom
Level II

Re: Show as graph reference lines

I'm not sure I follow you on the structure of my Spec Limits.  Below is the script I'm running to attach the limits, which populates all limits in columns specified.  This came from script examples in help.  Am I missing something?

I've tried 2 methods, neither were successful;

1.  Append your code to this script and run

2. Run this script against dt.  Save dt with spec limits.  Run above code in separate script.

Names Default to Here(1);

dt = Open( "C:\junk1_example.jmp" );

obj = Capability(

  Y(

  :Name( "Met1_Res/um" ),

  :Name( "Met2_Res/um" ),

  :Name( "Met3_Res/um" ),

  :Name( "Met4_Res/um" ),

  ),

  Spec Limits(:Name( "Met1_Res/um" ) (LSL(1.0), Target(1.3), USL(1.6) ),

  :Name( "Met2_Res/um" ) (LSL(1.0), Target(1.3), USL(1.6) ),

  :Name( "Met3_Res/um" ) (LSL(1.0), Target(1.3), USL(1.6) ),

  :Name( "Met4_Res/um" ) (LSL(1.0), Target(1.3), USL(1.6) )

  )

);

illinitom
Level II

Re: Show as graph reference lines

Sorry, missed final save specs cmd.

obj << Save Spec Limits as Column Properties;

txnelson
Super User

Re: Show as graph reference lines

I ran your included script, and found that the Capability Platform does create what I believe are incorrectly structured spec limit column properties.  I have sent this off to JMP for their response.

All that given, what has to change, is the method for extracting the current spec limits, given your current structure.  The new structure is not a List,

Here is the reworked script that I believe will work with your data.  Remember, once the Show Limits value is set, JMP will change the structure of the spec limit property, so future "get property("spec limits")" will return the spec limits as a list, not the strange structure assigned by the Capability Platform.

Names Default To Here( 1 );

dt=current data table();

// Get all of the numeric columns in the data table

Numeric Columns = dt << get column names( numeric, string );

// Loop across all of the columns and set the Show Limits

For( i = 3, i <= N Items( Numeric Columns ), i++,

       // If the request to get the spec limits returns an empty value the

       // column does not have spec limits, so don't set Show Limits

       If( Is Empty( Column( dt, Numeric Columns ) << get property( "spec limits" ) ) == 0,

              // This is the structure of the spec limits list. If you only set the

              // Show Limits, it will wipe out the other limits, so they need to be

              // retrieved and substituted into the structure

              speclimitvals = Char( column(dt,Numeric Columns) << get property( "spec limits" ) );

              LSL = Try( Num( Word( 2, Substr( speclimitvals, Contains( speclimitvals, "LSL(" ) ), "()" ) ), . );

              USL = Try( Num( Word( 2, Substr( speclimitvals, Contains( speclimitvals, "USL(" ) ), "()" ) ), . );

              Target = Try( Num( Word( 2, Substr( speclimitvals, Contains( speclimitvals, "Target(" ) ), "()" ) ), . );

              Eval(

                     Substitute(

                                  Expr(

                                         Column( dt, __col__ ) << Set Property(

                                                "Spec Limits",

                           {LSL( __LSL__ ), USL( __USL__ ), Target( __Target__ ), Show Limits( 1 )}

                           )

                    ),

                           Expr( __col__ ), Numeric Columns,

                           Expr( __LSL__ ), LSL,

                            Expr( __USL__ ), USL,

                           Expr( __Target__ ), Target

                     )

              );

       )

);

Jim
illinitom
Level II

Re: Show as graph reference lines

It works brilliantly Jim.  Thank you!!!