Spec limits issueHi,
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.
Re: Spec limits issueThanks Jim. I made it to work.
Re: Spec limits issueThe Column Dialog() function has been downgraded in importance in favor of using a New Window. Here is an example of one way to choose columns and to pass them to a Platform. This example is taken from
Help==>Books==>Scripting Guide, page 445
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
xvar = .;
yvar = .;
win = New Window( "Return Values",
<<MODAL></MODAL>
Re: Spec limits issueThanks Jim. I went through that and found somethig like this script:
Column Dialog(
ex y = ColList( "Y", Min Col( 1 ), Max Col( 80 ), Data Type( "Numeric" ) ),
ex x = ColList( "X", Max Col( 1 ), Modeling Type( {"Continuous", "Multiple Response"} ) )
);
How do I use the above column selection to do Distribution/Histogram for instance.
Thanks.
Re: Spec limits issueYou question how to enter the column specification for the Distribution Platform. The syntax that is required to run any given platform can be determined by
1. Running the platform interactively, and then saving the script, and examining it for what is required to run multiple columns.
2. To to
Help==>Scripting Index
and then go to the Platform of choice (i.e. Distribution) and going through the various examples provided in the index.
Re: Spec limits issueThanks Jim. That's very helpful.
Can you choose the columns you want to do the histogram in the script? It looks like you have to list them one by one using Continuous Distribution.
I appreciate any help/comments. Thanks
Re: Spec limits issueThe Capability Platform does not automatically save the Spec Limits to the column properties. They have to have the message
obj << Save Spec Limits as Column Properties.
specified.
Then, you can run the Distribution Platform. But contrary to how you have it listed, the Distribution is not passed to the Object associated with the Capability Platform, it is passed to the data table
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
obj = dt << Capability(
Y( :OZONE, :CO, :SO2, :NO ),
Spec Limits(
Import Spec Limits(
"$SAMPLE_DATA/CitySpecLimits.jmp"
)
)
);
obj << Save Spec Limits as Column Properties;
Dis = dt << Distribution(
Continuous Distribution( Column( :OZONE ) ),
Continuous Distribution( Column( :CO ) ),
Continuous Distribution( Column( :SO2 ) ),
Continuous Distribution( Column( :NO ) )
);
This is all detailed in the message documentation in the Scripting Index
Help==>Scripting Index==>Capability
Re: Spec limits issueThanks Jim. I like to be able to import the spec limit and show histogram with spec limit and also Cpk analysis.
I wrote the following script and it does not show the histogram:
dt = Current data table();
obj = Capability(
Y( :A ),
Spec Limits( Import Spec Limits( "$Documents/JMP/SpecA.jmp" ) ),
Individual Detail Reports( 1 ),
Capability Box Plots( 0 ),
Goal Plot( 0 )
);
obj << Distribution( Continuous Distribution( Column( : A),
Capability Analysis( 1 ) ) );
obj << Histogram(1, Show Spec Limits(1));
I appreciate your further help. Thanks
Re: Spec limits issueMy 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 ) ) );Re: Spec limits issueHi,
How do I import Spec Limit without doing any capability analysis in a script ?
Thanks
Re: Spec limits issueHi,
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
Re: Spec limits issueThanks 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
Re: Spec limits issueCan you post the value of the variable "names"? It may not like the format for your list of column names.
Re: Spec limits issueHi,
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
Re: Spec limits issueAside 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.
Re: Spec limits issueThere 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
Re: Spec limits issueI'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\")