Choose Language Hide Translation Bar
Highlighted
midori555
Level II

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
Highlighted

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;

View solution in original post

3 REPLIES 3
Highlighted
txnelson
Super User

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
Highlighted
midori555
Level II

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

Highlighted

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;

View solution in original post

Article Labels

    There are no labels assigned to this post.