cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMPĀ® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Sebastienlg
Level II

JMP Script: Message with if condition

Hi all, 

I am trying to make a control chart based on a condition. 

However, I received a message when the condition Eval(Y) is not present in the without_limits list (else condition).

Here is my program:

 

If (Contains(without_limits,Eval(Y)),
		graph=Control Chart Builder(
				Variables(
					Subgroup( :X ),
					Y( Eval(Y) ),
					Phase(:"Version")
				)
			),
		graph = RAW_DATA_TABLE << 
				Control Chart Builder(
					Size( 534, 450 ),
					Show Two Shewhart Charts( 0 ),
					Show Control Panel( 0 ),			
					Sort by Row Order( 1 ),
					Show Limit Summaries( 0 ),
					Variables( Y( Eval(Y) ),Subgroup( :X ), Phase(:"Version")),	
					Get Limits(LIMIT_TABLE),
				),
		N = N Items( phaseLevels );
		// On met en forme les lignes
		For( i = 1, i <= N Items( phaseLevels ), i++,
			graph << SendToReport(
					Dispatch(
						{},
						"Control Chart Builder",
						OutlineBox,
						{Set Title( "ReprƩsentation graphique" )},
						FrameBox( 2 ),
						{
						DispatchSeg( Line Seg( Eval(3*i+N-2) ),		{Line Color( "Medium Light Green" ),Line Style( "Dotted" ), Line Width( 1.5 )} ),
						DispatchSeg( Line Seg( Eval(3*i+1+N-2) ),	{Line Color( "Medium Light Orange" ), Line Style( "Dotted" ), Line Width( 2.5 )}),
						DispatchSeg( Line Seg( Eval(3*i+2+N-2) ),	{Line Color( "Medium Light Red" ), Line Style( "Dotted" ), Line Width( 2.5 )})
						}
					)
				)
			)
		)

Here is the message I get:

"Check that the script does not contain an assignment with a single = sign, where an equality test with two == signs is expected. The expression is: ..."

 

Sebastienlg_0-1681811834955.png

However after clicking on the continue button it is working...

Any idea to help me understand this message?

Sebastien

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: JMP Script: Message with if condition

It could be due to both of these 

jthi_0-1681908211668.png

Should the N Items be already outside if statement?

-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: JMP Script: Message with if condition

Make sure your , are in correct locations

If(Contains(without_limits, Eval(Y)), 
	graph = Control Chart Builder(Variables(Subgroup(:X), Y(Eval(Y)), Phase(:"Version")))
,
	graph = RAW_DATA_TABLE << Control Chart Builder(
		Size(534, 450),
		Show Two Shewhart Charts(0),
		Show Control Panel(0),
		Sort by Row Order(1),
		Show Limit Summaries(0),
		Variables(Y(Eval(Y)), Subgroup(:X), Phase(:"Version")),
		Get Limits(LIMIT_TABLE),
	)
, N = N Items(phaseLevels);
	For(i = 1, i <= N Items(phaseLevels), i++,
		graph << SendToReport(Dispatch(
			{},
			"Control Chart Builder",
			OutlineBox,
			{Set Title("ReprƩsentation graphique")},
			FrameBox(2),
			{DispatchSeg(Line Seg(Eval(3 * i + N - 2)), {Line Color("Medium Light Green"), Line Style("Dotted"), Line Width(1.5)}),
			DispatchSeg(Line Seg(Eval(3 * i + 1 + N - 2)), {Line Color("Medium Light Orange"), Line Style("Dotted"), Line Width(2.5)}),
			DispatchSeg(Line Seg(Eval(3 * i + 2 + N - 2)), {Line Color("Medium Light Red"), Line Style("Dotted"), Line Width(2.5)})}
		))
	);
);
-Jarmo
Sebastienlg
Level II

Re: JMP Script: Message with if condition

I had a look and all the "," seem ok.

Couldn't it come from hte , in red below?

...
Get Limits(LIMIT_TABLE), ) , N = N Items(phaseLevels);
...
jthi
Super User

Re: JMP Script: Message with if condition

It could be due to both of these 

jthi_0-1681908211668.png

Should the N Items be already outside if statement?

-Jarmo
Sebastienlg
Level II

Re: JMP Script: Message with if condition

Right!

I wasn't looking at this ")"

Now it works well!

thank you