cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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

Recommended Articles