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
AT
AT
Level V

Spec limits issue

Hi,

I am trying to import spec limits and having some error when I ran the script. Here is the script and error:

 

dt = Current Data Table();

 

 

Eval(

 

Parse(

   "obj = dt << Process Capability(

Process Variables( "|| names ||

" ),

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

 

    )

);

 

 The names varaible has all columns and worked fine in other script. I appreciate any help.

 

1 ACCEPTED SOLUTION

Accepted Solutions
AT
AT
Level V

Re: Spec limits issue

Thanks Jim. I made it to work.

View solution in original post

16 REPLIES 16
David_Burnham
Super User (Alumni)

Re: Spec limits issue

I've only given the script a quick glance, but one problem I see is that you have quotes contained within your quoted string.  Specifically the name of the table is in quotes, and those quotes are part of a larger quoted string.  To embed quotes within a string you need to use the escape sequence \!" ... so where you have Import Spec Limits("SpecA.jmp") you need Import Spec Limits(\!"SpecA.jmp\")

-Dave
txnelson
Super User

Re: Spec limits issue

There is an Addin that populates limits into a data table, from another JMP limits table.  See

Write Limits to a Data Table from a Limits Table

Jim
cwillden
Super User (Alumni)

Re: Spec limits issue

Aside from using "\[ ]\" to mask double quotes in a string, I also find that the Eval Insert() function is very handy for including the values of variables in a string, like the variable "names".  You can insert the values of variables into a string using the carrot symbol "^".  Here's how you might be able to get this to work:

dt = Current Data Table();

Eval(
	Parse(
		Eval Insert("\[obj = dt << Process Capability(
			Process Variables(  ^names^ ),
			Spec Limits(Import Spec Limits( "$DESKTOP/SpecA.jmp") ) );]\"
		)
    )
);

Of course, your SpecA.jmp may not be on your desktop.  Just make sure the path is correct for that file.

-- Cameron Willden
AT
AT
Level V

Re: Spec limits issue

Hi,

Thanks for all your suggestions. I am still getting an error with the last suggestion.

 

Exception in platform launch in access or evaluation of 'Process Capability' , Process Capability(/*###*/Process Variables(

:A,B,...

 

Any further help is appreciated. Thanks

 

cwillden
Super User (Alumni)

Re: Spec limits issue

Can you post the value of the variable "names"?  It may not like the format for your list of column names.

-- Cameron Willden
AT
AT
Level V

Re: Spec limits issue

Thanks for the reply and feedback. Here is what the definition of "names" is

 

lstNames = dt << Get Column Names( string, Numeric );

 

  names = ":" || lstNames[1];

 

  For( i = 2, i <= N Items( lstNames ), i++,

names = names || ",:" || lstNames[i]

  );

 

I have used "names" in other part of JMP script and no issue. Thanks

AT
AT
Level V

Re: Spec limits issue

Hi,

I found out that in my list of columns for some reason A_B is written as A-B and fixing this will work with the following script.

 

Eval(

Parse(

Eval (

"obj = dt << Capability(

Y(" || names || "),

Spec Limits(Import Spec Limits(\!"SpecA.jmp\!") ) );"

)

    )

);

 

Thank you all for great support. Best

AT
AT
Level V

Re: Spec limits issue

Hi,

How do I  import Spec Limit without doing any capability analysis in a script ? 

 

Thanks

txnelson
Super User

Re: Spec limits issue

My suggestion is that you import the spec limits as column propery, independent from the Distribution Platform.  then when you run the platform, you specify,

     

Distribution( 
     Continuous Distribution( Column( :NPN1 ), 
     Capability Analysis( 0 ) )
);

Examples of all elements availabe to any of the platforms is available in the scripting index

     Help==>Scripting Index

I suggest you familiarize yourself with it.  It is the answer to most of your questions.

An example:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
USL = 70;
LSL = 55;
Eval(
	Substitute(
			Expr(
				:Height << set property( "spec limits", {LSL( __LSL__ ), USL( __USL__ ),Show Limits(1)} )
		
			),
		Expr( __LSL__ ), LSL,
		Expr( __USL__ ), USL
	)
);
Distribution( Continuous Distribution( Column( :height ), Capability Analysis( 0 ) ) );
Jim