cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

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