cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Have your say in shaping JMP's future by participating in the new JMP Wish List Prioritization Survey
Choose Language Hide Translation Bar
neelsrejan
Level III

Subset window of variability chart's by tree structure into subsetted window in JSL

Hi all, 

 

I am running into an issue with my script after I created a dynamic variability chart of approximately 30 charts but want to subset a small amount into another window but am unable to do so. For company policy I can't post the code but have used an example of what I am trying to do using JMP Sample Data as seen below.

dt = Open("C:\Program Files\SAS\JMP\17\Samples\Data\Quality Control\Braces.jmp");

vc = Variability Chart(
	Y( :"# defects"n ),
	Model( "Main Effect" ),
	X( :Date ),
	Variability Analysis(
		:"# defects"n,
		Show Range Bars( 0 ),
		Show Cell Means( 0 ),
		Std Dev Chart( 0 )
	),
	By( :Unit size )
);

subset_vc = New Window("Only some vc", vlis = V List Box());
frameboxes_to_subset = {1, 3, 5}; // Want to get when unit size = 4, 8, 12
vc_rpt = vc << Report;
show(N Items( (vc_rpt << XPath( "//FrameBox" )) ));
structure = vc_rpt << Show tree structure;
for(i = 1, i <= N Items(frameboxes_to_subset), i++,
	vlis << append(vc_rpt[FrameBox(frameboxes_to_subset[i])]);
);

I am able to see in the log that the original vc_rpt has 6 Frameboxes as expected, but when I try to subset them based on the Framebox number seen in the "show tree structure", no graph is appended. I have also tried wrapping it in an additional V List Box and similarly nothing has worked to add to the new window. Any help would be greatly appreciated. Thanks! 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Subset window of variability chart's by tree structure into subsetted window in JSL

Your error is in thinking that all of the images are in one report.  Instead, there are 6 reports, each with one image.

Therefore your code needs to be changed to looping through a specified report and grabbing framebox(1) from each report.

dt = Open("C:\Program Files\SAS\JMP\17\Samples\Data\Quality Control\Braces.jmp");

vc = Variability Chart(
	Y( :"# defects"n ),
	Model( "Main Effect" ),
	X( :Date ),
	Variability Analysis(
		:"# defects"n,
		Show Range Bars( 0 ),
		Show Cell Means( 0 ),
		Std Dev Chart( 0 )
	),
	By( :Unit size )
);

subset_vc = New Window("Only some vc", vlis = V List Box());
frameboxes_to_subset = {1, 3, 5}; // Want to get when unit size = 4, 8, 12
vc_rpt = vc << Report;
//show(N Items( (vc_rpt << XPath( "//FrameBox" )) ));
//structure = vc_rpt << Show tree structure;
for(i = 1, i <= N Items(frameboxes_to_subset), i++,
	vlis << append(vc_rpt[frameboxes_to_subset[i]][FrameBox(1)]);
);

txnelson_0-1717547690582.png

I am also thinking that you might not want to be pulling just the FrameBox(), but instead pulling the PictureBox()

txnelson_1-1717547966131.png

subset_vc = New Window("Only some vc", vlis = V List Box());
frameboxes_to_subset = {1, 3, 5}; // Want to get when unit size = 4, 8, 12
vc_rpt = vc << Report;
//show(N Items( (vc_rpt << XPath( "//FrameBox" )) ));
//structure = vc_rpt << Show tree structure;
for(i = 1, i <= N Items(frameboxes_to_subset), i++,
	vlis << append(vc_rpt[frameboxes_to_subset[i]][PictureBox(1)]);
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Subset window of variability chart's by tree structure into subsetted window in JSL

Your error is in thinking that all of the images are in one report.  Instead, there are 6 reports, each with one image.

Therefore your code needs to be changed to looping through a specified report and grabbing framebox(1) from each report.

dt = Open("C:\Program Files\SAS\JMP\17\Samples\Data\Quality Control\Braces.jmp");

vc = Variability Chart(
	Y( :"# defects"n ),
	Model( "Main Effect" ),
	X( :Date ),
	Variability Analysis(
		:"# defects"n,
		Show Range Bars( 0 ),
		Show Cell Means( 0 ),
		Std Dev Chart( 0 )
	),
	By( :Unit size )
);

subset_vc = New Window("Only some vc", vlis = V List Box());
frameboxes_to_subset = {1, 3, 5}; // Want to get when unit size = 4, 8, 12
vc_rpt = vc << Report;
//show(N Items( (vc_rpt << XPath( "//FrameBox" )) ));
//structure = vc_rpt << Show tree structure;
for(i = 1, i <= N Items(frameboxes_to_subset), i++,
	vlis << append(vc_rpt[frameboxes_to_subset[i]][FrameBox(1)]);
);

txnelson_0-1717547690582.png

I am also thinking that you might not want to be pulling just the FrameBox(), but instead pulling the PictureBox()

txnelson_1-1717547966131.png

subset_vc = New Window("Only some vc", vlis = V List Box());
frameboxes_to_subset = {1, 3, 5}; // Want to get when unit size = 4, 8, 12
vc_rpt = vc << Report;
//show(N Items( (vc_rpt << XPath( "//FrameBox" )) ));
//structure = vc_rpt << Show tree structure;
for(i = 1, i <= N Items(frameboxes_to_subset), i++,
	vlis << append(vc_rpt[frameboxes_to_subset[i]][PictureBox(1)]);
);
Jim
neelsrejan
Level III

Re: Subset window of variability chart's by tree structure into subsetted window in JSL

Thanks Jim, 

 

Interesting, will read up on that as I thought a window represented a "page" of a journal such that there would only be one. Appreciate the help!