cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
NetflixCrow956
Level III

word missing

dt<< New Column( "op status", Character, "Nominal", Set Selected );

If( Is Missing( Column( dt, "Status Operation" )[x],Word( 1, "PCNF" ) | Word( 1, "CNF" ) ), Column(dt, "op status") == "Q" );

Hello everyone, I would like to create a new column and in this column, if the words PCNF or CNF do not appear in the column :Status Operation, on this line, put "Q" in the Column :op status but I do not know the syntax. I thank you for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: word missing

Here's a column formula that will work:

dt << New Column( "op status", Character, "Nominal",
		Formula(
			If(
				!Contains( :Status Operation, "PCNF" ) &
				!Contains( :Status Operation, "CNF" ),
				"Q"
			)
		)
	);

View solution in original post

3 REPLIES 3
jthi
Super User

Re: word missing

Using a formula (or << Set Each Value) is easiest option. What type of formula to use depends on what sort of values your Status Operation has. Could you provide couple of example values from that column?

-Jarmo
pmroz
Super User

Re: word missing

Here's a column formula that will work:

dt << New Column( "op status", Character, "Nominal",
		Formula(
			If(
				!Contains( :Status Operation, "PCNF" ) &
				!Contains( :Status Operation, "CNF" ),
				"Q"
			)
		)
	);
txnelson
Super User

Re: word missing

Try this

dt << New Column( "op status",
	Character,
	"Nominal",
	Set Selected,
	formula(
		If(
			Is Missing( :Status Operation ) | (Contains( :Status Operation, "PCNF" ) == 0 &
			Contains( :Status Operation, "CNF" ) == 0),
			"Q",
			:Status Operation
		)
	)
);
Jim