Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
manja
Level I

Variable to a JMP plot

Hi,

    I am new to JSL and need some help.. I want to get a script for variability plot but i want to pass a value that would control whether i need the variability summary report or not.. I tried the following as shown below but it seems to print variability summary report all time.. 

In the code below, if control is set to 1 i want the varibility summary report. If set to 0 i want to disable variability summary report... 

If i hardcode it to Variability Summary Report(1) or Variability Summary Report(0) it works

 

 

control = 0;
New Window( "Variability Chart of RRAW_BER",
	V List Box(
		Variability Chart(
			Y( :RRAW_BER ),
			X( :SERIAL_NUM, :HD_PHYS_PSN, :DATA_ZONE ),
			Connect Cell Means( 1 ),
			Std Dev Chart( 0 ), 

			Points Jittered( 1 ), 

			Variability Summary Report( control ),
			SendToReport(
				Dispatch(
					{"Variability Chart for RRAW_BER"},
					"Variability Chart",
					FrameBox,
					{Row Legend(
						:SPC_ID_x,
						Color( 1 ),
						Color Theme( "JMP Default" ),
						Marker( 0 ),
						Marker Theme( "" ),
						Continuous Scale( 0 ),
						Reverse Scale( 0 ),
						Excluded Rows( 0 )
					)}
				)
			)
		)
	)
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
cwillden
Super User

Re: Variable to a JMP plot

That is somewhat surprising, but here's an easy work around.  Just swap in this line:

parse(eval insert("Variability Summary Report( ^control^ )"))

Bit of a hack, but that should work for you.  It evaluates the value of "control" in a string and then parses the string into an expression for evaluation.

A cleaner solution would be to name the variability chart object and then send the message to add the variability chart or not after the variability report already exists.  Here's an example with 2 Factors Crossed sample data:

dt = Current Data Table();
control = 1;

varchart = dt << Variability Chart(
	Y( :Measurement ),
	X( :Operator, :part# ),
	Standard( :Standard )
);

if(control, varchart << Variability Summary Report( 1 ))
-- Cameron Willden

View solution in original post

2 REPLIES 2
Highlighted
cwillden
Super User

Re: Variable to a JMP plot

That is somewhat surprising, but here's an easy work around.  Just swap in this line:

parse(eval insert("Variability Summary Report( ^control^ )"))

Bit of a hack, but that should work for you.  It evaluates the value of "control" in a string and then parses the string into an expression for evaluation.

A cleaner solution would be to name the variability chart object and then send the message to add the variability chart or not after the variability report already exists.  Here's an example with 2 Factors Crossed sample data:

dt = Current Data Table();
control = 1;

varchart = dt << Variability Chart(
	Y( :Measurement ),
	X( :Operator, :part# ),
	Standard( :Standard )
);

if(control, varchart << Variability Summary Report( 1 ))
-- Cameron Willden

View solution in original post

Highlighted
manja
Level I

Re: Variable to a JMP plot

Thanks a lot @cwillden appreciate it.. I liked the easy workaround as it fits my script well, but it doesnt seem to be working (i cant get teh variability summary at all).. However the cleaner solution you provided works.. 

 

Article Labels

    There are no labels assigned to this post.