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
ChrisNally
Level II

If Statement to add a yes/no column

Good Morning

                         Any help here would be much appreciated. I am trying to add a new column that will add either a yes or a no based on a Bx no. range

So in table below any Bx No before 10732 would return a "Yes" in the 0.3mic column and any Bx No after would return a "No".

Thanks in advance.

 

Chris

      

C_LOT_NAMEPRODUCTSAMPLE_TYPEAverage Pigment Strength0.3mic filtered
10128CYAN_J2VLOT_FINISHED  
10128CYAN_J2VLOT_FINISHED10.14 
10200CYAN_J2VLOT_FINISHED12.26 
10200CYAN_J2VLOT_FINISHED  
10240CYAN_J2VLOT_FINISHED12.06 
10240CYAN_J2VLOT_FINISHED  
10377CYAN_J2VLOT_FINISHED11.965 
10487CYAN_J2VLOT_FINISHED12.145 
10487CYAN_J2VLOT_FINISHED12.075 
10634CYAN_J2VLOT_FINISHED  
10634CYAN_J2VLOT_FINISHED12.195 
10682CYAN_J2VLOT_FINISHED12.035 
10697CYAN_J2VLOT_FINISHED12.1 
10732CYAN_J2VLOT_FINISHED12.13 
10733CYAN_J2VLOT_FINISHED12.265 
10871CYAN_J2VLOT_FINISHED12.155 
10872CYAN_J2VLOT_FINISHED12.155 
10873CYAN_J2VLOT_FINISHED12.035 
10874CYAN_J2VLOT_FINISHED12.145 
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: If Statement to add a yes/no column

Try this

dt << New Column( "0.3mic filtered ",
	Character,
	Nominal,
	Formula(
		If( Num( :C_LOT_NAME ) < 10732,
			"YES",
			"No"
		)
	)
);
Jim

View solution in original post

3 REPLIES 3
ChrisNally
Level II

Re: If Statement to add a yes/no column

 I tried this but only get No returned in the column:

 

 

dt << New Column( "0.3mic filtered ",
    Character,
    Nominal,
    Formula(
        If(
            :C_LOT_NAME == "<10732"
        ,
            "YES",
            "No"
        )
    )
);

 

txnelson
Super User

Re: If Statement to add a yes/no column

Try this

dt << New Column( "0.3mic filtered ",
	Character,
	Nominal,
	Formula(
		If( Num( :C_LOT_NAME ) < 10732,
			"YES",
			"No"
		)
	)
);
Jim
ChrisNally
Level II

Re: If Statement to add a yes/no column

Hi

     Thank you very much, this worked well. Your help is much appreciated.

 

Regards

Chris