cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.

Discussions

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

How can I write a good condition if else if in JMP

Hello I have several columns with data and I want to add another col which will get a formula like this:

A B C

2 5

3 4

5 5

4 7

C column will get an if else formula for example: If(A&B==4 then C ==Good) else if(A&B==3 then C ==bad) else if(A&B==1 then C ==Good)

How can I write this in a formula ?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Craige_Hales
Super User

Re: How can I write a good condition if else if in JMP

If Secrets has a good description of how to use the If() function.

Craige

View solution in original post

pmroz
Super User

Re: How can I write a good condition if else if in JMP

This code will do what you described:

New Table( "Untitled", Add Rows( 6 ),
	New Column( "A", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [2, 3, 5, 4, 4, 1] ) ),
	New Column( "B", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [5, 4, 5, 7, 4, 1] ) ),
	New Column( "C", Character, "Nominal", Formula(
			If( :A == 4 & :B == 4, "Good",
				:A == 3 & :B == 3, "Bad",
				:A == 1 & :B == 1, "Good"
			)
		)
	)
);

Craig's link is excellent, especially because it discusses what happens with null values. 

View solution in original post

2 REPLIES 2
Craige_Hales
Super User

Re: How can I write a good condition if else if in JMP

If Secrets has a good description of how to use the If() function.

Craige
pmroz
Super User

Re: How can I write a good condition if else if in JMP

This code will do what you described:

New Table( "Untitled", Add Rows( 6 ),
	New Column( "A", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [2, 3, 5, 4, 4, 1] ) ),
	New Column( "B", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [5, 4, 5, 7, 4, 1] ) ),
	New Column( "C", Character, "Nominal", Formula(
			If( :A == 4 & :B == 4, "Good",
				:A == 3 & :B == 3, "Bad",
				:A == 1 & :B == 1, "Good"
			)
		)
	)
);

Craig's link is excellent, especially because it discusses what happens with null values. 

Recommended Articles