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.
Thanks Jim. I made it to work.
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\")
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
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.
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
Can you post the value of the variable "names"? It may not like the format for your list of column names.
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
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
Hi,
How do I import Spec Limit without doing any capability analysis in a script ?
Thanks
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 ) ) );