Choose Language Hide Translation Bar
Highlighted
SW
SW
Level II

List expression only evaluates the first Value

I'm trying to repair as script that was rendered non-functional by the JMP15 rollout.  

 

I have a List variable that contains column numbers of interest.

ListofColumns= List(8,12,7,14);

I'm trying to generate a set of control charts, in a single window, of each of the columns in the list:

Win4=Control Chart Builder(
	Show Control Panel( 0 ),
	Show Limit Summaries( 0 ),
	Show Capability( 0 ),
	Variables(Y(eval(ListofColumns)))
);

When I run this code, It generates the proper control chart for column 8, but none of the others.  

 

On the other hand, If I manually put the list in, all four control charts are generated properly:

Win4=Control Chart Builder(
	Show Control Panel( 0 ),
	Show Limit Summaries( 0 ),
	Show Capability( 0 ),
	Variables(Y(8,12,7,14))
);

I'm sure this used to work with code before control chart builder.  And I'm also sure I'm missing something simple.  Appreciate any help!

2 REPLIES 2
Highlighted
txnelson
Super User

Re: List expression only evaluates the first Value

I tested you code back to JMP 11 and found the code worked the same.  Below is what I consider an ugly work around, and I hope someone has a better solution

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/blood pressure.jmp" );
ListofColumns = List( 8, 4, 7, 5 );

Eval(
	Parse(
		"Win4=Control Chart Builder(
	Show Control Panel( 0 ),
	Show Limit Summaries( 0 ),
	Show Capability( 0 ),
	Variables(Y( "
		 || Substr(
			Char( listofcolumns ),
			2,
			Length( Char( listofcolumns ) ) - 2
		) || " )
));"
	)
);
Jim
Highlighted
SW
SW
Level II

Re: List expression only evaluates the first Value

Thanks for the tip.  But I ended up taking a different approach, looping through each value in the list:

For( j = 1, j <= N Items(ListofColumns), j++, //step through the row numbers of interest

	WinHandle3 << append (Control Chart(     //append the control chart to existing window
	Sample Label( :Lot_Number ),			// using legacy Control Chart platform allows sample label use
	Group Size( 1 ),
	KSigma( 3 ),
	Chart Col(
		ListofColumns[j],
		Individual Measurement,
		Moving Range
	)));
	
);	// close the for loop.

I just appended each chart to an existing window.  I also changed to using the legacy Control Chart platform instead of the (improved?) Control Chart builder, because I wanted to specify the sample label instead of a meaningless sequential number on the X-axis.  The script above seems to work.

Article Labels