BookmarkSubscribeSubscribe to RSS Feed
Highlighted
midori555

New Contributor

Joined:

Aug 8, 2018

How to use JSL to generate control chart and save the scripts in data table

I was trying to generate the control chart and save the lengthythe script to the data table at the same time. The control chart script is lengthy. So instead of doing copy & paste the long script shown below is there a sophisticated way to do it?

Any help appreciated. 

 

 

Names Default To Here( 1 );
dt = Current Data Table();
Control Chart(
SendToByGroup( {:group == "A"} ),...
....
);
dt << New Script(
"Control Chart by weight",
Control Chart(
SendToByGroup( {:group == "A"} ),...
...
);
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
tonya_mauldin0

Joined:

Jan 21, 2015

Solution

Re: How to use JSL to generate control chart and save the scripts in data table

You need to use the command Save By Group script to data table.

 

dt=Open("$SAMPLE_DATA/Big Class.jmp");
obj=dt<<Control Chart(
 Sample Label( :age ),
 KSigma( 3 ),
 Chart Col( :height, XBar, R ),
 By( :sex )
);


obj[1]<<Save By Group script to data table;

3 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

Re: How to use JSL to generate control chart and save the scripts in data table

You can save the script right with the generation of the Control Chart.  Here is the example from the Scripting Index that shows you how you can do it.  You can do the same with the code you displayed, without having to do a separate step.

Names Default To Here( 1 );
dt = Open(
	"$SAMPLE_DATA/Quality Control/Coating.jmp"
);
obj = Control Chart(
	Sample Size( 1 ),
	Chart Col( :Weight ),
	Chart Type( Run Chart )
);
obj <<
Save Script to Data Table(
	"My Analysis",
	<<Prompt( 0 ),
	<<Replace( 0 )
);
Jim
midori555

New Contributor

Joined:

Aug 8, 2018

Re: How to use JSL to generate control chart and save the scripts in data table

In my original control charts I had "SendToByGroup(...." as part of the scripts.

If I do the following each plot is saved individually resulting in tens of scripts. Is there a way to fix it? Appreciated!

obj <<Save Script to Data Table(
	"My Analysis",
	<<Prompt( 0 ),
	<<Replace( 0 )
)

 Capture-3.JPG

tonya_mauldin0

Joined:

Jan 21, 2015

Solution

Re: How to use JSL to generate control chart and save the scripts in data table

You need to use the command Save By Group script to data table.

 

dt=Open("$SAMPLE_DATA/Big Class.jmp");
obj=dt<<Control Chart(
 Sample Label( :age ),
 KSigma( 3 ),
 Chart Col( :height, XBar, R ),
 By( :sex )
);


obj[1]<<Save By Group script to data table;