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
kyawkag
Level I

JMP Script: How do I select rows based on variable cell value?

Hi,

I'm trying to write a script to select the rows with either the SerialNo or the Data value of 1-25 (highlighted rows below).

Is there a way to select these cells with variable?

e.g

data table ()  << select where (:Item == "SerialNo[1-25] ");

 

kyawkag_1-1629795326667.png

 

1 REPLY 1
jthi
Super User

Re: JMP Script: How do I select rows based on variable cell value?

You might be able to use something like this:

dt << Select Where(0 < :Num(Word(2, :Item, "[]")) < 26);
Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(5),
	Compress File When Saved(1),
	New Column("Item",
		Character,
		"Nominal",
		Set Values({"SerialNo[1]", "SerialNo[4]", "SerialNo[26]", "Data[2]", "Data[30]"}),
		Set Display Width(75)
	)
);

dt << Select Where(0 < :Num(Word(2, :Item, "[]")) < 26);

jthi_0-1629799235531.png

 

-Jarmo