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.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
justvince
Level III

Is there a simple way to add scripts to the data table if they do not already exist?

I want to run a script (perhaps multiple times) and part of the script embeds a script into the data table.

E.g., dt << New Script ("Plot", varchart1= variability Chart(...... 

Every time I run the main script it will create scripts Plot 1, Plot 2 ect... in the data table. 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Is there a simple way to add scripts to the data table if they do not already exist?

Here is one way to handle your question

Names Default To Here( 1 );
dt = Current Data Table();

theScripts = dt << get table script names;

If( N Rows( Loc( theScripts, "Plot" ) ) == 0,
	dt << New Script( "Plot", varchart1 = variability Chart(.......
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Is there a simple way to add scripts to the data table if they do not already exist?

Here is one way to handle your question

Names Default To Here( 1 );
dt = Current Data Table();

theScripts = dt << get table script names;

If( N Rows( Loc( theScripts, "Plot" ) ) == 0,
	dt << New Script( "Plot", varchart1 = variability Chart(.......
);
Jim
justvince
Level III

Re: Is there a simple way to add scripts to the data table if they do not already exist?

Nice!  It works.

 

I tried something very similar but did not have the N rows.  That is a great trick!

Recommended Articles