cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Zahzul
Level I

How do I input a variable into "Historical Data End at Row" option for Multivariate Control Chart in JSL?

Hello.

This is taken from one of the Scripting Index script.

I was trying to write a JSL that essentially will have row_end as a dynamic input, but my current code below wouldn't work as intended.

How do I write it so that it can work? I've tried putting the whole expression into Eval (Eval Parse(Expression)) but that also did not work.

If I replace row_end with it's actual value, only then will my code work. Any ideas? Thanks.

I'm using JMP16.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Quality Control/Flight Delays.jmp" );
row_end = 16;
obj = dt << Model Driven Multivariate Control Chart( Process( :AA, :CO, :DL, :F9, :FL, :NW, :UA, :US, :WN ), Historical Data End at Row( row_end ) );
1 REPLY 1
txnelson
Super User

Re: How do I input a variable into "Historical Data End at Row" option for Multivariate Control Chart in JSL?

The "Historical Data End at Row()" appears to not be able to evaluate a variable. Therefore, one needs to handle that in JSL.  A common way to do that is to use "Eval Insert()".

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Quality Control/Flight Delays.jmp" );
row_end = 16;
Eval(
	Parse(
		Eval Insert(
			"obj = dt << Model Driven Multivariate Control Chart( Process( :AA, :CO, :DL, :F9, :FL, :NW, :UA, :US, :WN ), Historical Data End at Row( ^row_end^ ))"
		)
	)
);

Or, one could use a Substitute() function to handle the issue

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Quality Control/Flight Delays.jmp" );
row_end = 16;
Eval(
	Substitute(
			Expr(
				obj = dt << Model Driven Multivariate Control Chart(
					Process( :AA, :CO, :DL, :F9, :FL, :NW, :UA, :US, :WN ),
					Historical Data End at Row( theEnd )
				)
			),
		Expr( theEnd ), row_end
	)
);
Jim

Recommended Articles