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
Josee
Level III

If select where does not find value then do x else continue with rest of script

Hello and Happy Friday,

 

I am trying to find a way around this one. I have a part in my script where it uses the following below. The issue I have is when it does not find the value ABC in Column1. Basically, I want it to where it runs the code below but if it does not find ABC, then I want it to save a blank table (csv) and stop running the rest of the code. If it does find ABC , then I want it to continue with the rest of the code. Any help will be appreciated.

 

 

Line 1: dt << select where( :Column1 =="ABC" ););
Line 2: dt2=dt << Subset( Output Table( "ABC" ), Selected Rows( 1 ) ););

 

 

1 REPLY 1
txnelson
Super User

Re: If select where does not find value then do x else continue with rest of script

Here is a simple example script that should do what you want

dt << select where( :Column1 =="ABC" );
If( nrows(dt << get selected rows) == 0,
	dtx = new table("no rows");
	dtx << save("...........csv");
	stop();
);

dt2=dt << Subset( Output Table( "ABC" ), Selected Rows( 1 ) );
Jim

Recommended Articles