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
mhd7
Level II

using the same script in multiple data tables

Hi everyone, 

 

I am relatively new to JMP and have a "is this possible" question. I have 10 data tables that are identical in terms of columns and type of data, but have different values in each column as they are sorted by staff member. For the first person, I used graph builder to create 9 graphs. I saved the script to the data table as well as to the script window. My question is, since the columns are identical in each of the 10 data tables, can I run the script from the first data table to automatically create the same 9 graphs in the other 9 data tables? Or, do I need to rebuild the 9 graphs in each of the data tables?

 

Thank you for your help!

9 REPLIES 9

Re: using the same script in multiple data tables

Yes, this is possible. You could make one of the new tables the "active" table and run the script from the script editor window.

Or you could copy the saved script from the data table and paste them into the new data tables and run that way.

Dan Obermiller
txnelson
Super User

Re: using the same script in multiple data tables

You could also edit the table script, and put a very simple dialog box, that asks the users what data table to run the script on.

Jim
mhd7
Level II

Re: using the same script in multiple data tables

Thank you very much for your fast reply. When I copy the script for a graph and paste in "new script" it wants to pull from the original sheet. How do I tell it to run the variables within the current source and not from another table?

txnelson
Super User

Re: using the same script in multiple data tables

So you have let say data table A, and you run a graph on it.

You then copy and save that script to a different data table, lets say is called data table B, and you run it from the new data table, and you say that it goes back to data table A to get the data for the latest graph?

Jim
mhd7
Level II

Re: using the same script in multiple data tables

Exactly!

txnelson
Super User

Re: using the same script in multiple data tables

please post the script so we can see what is in the data table that may be forcing it back to the original table
Jim

Re: using the same script in multiple data tables

Might need some more details then. Let me show you how/what I would do. I have two tables, Untitled and Untitled 2. Both tables have two columns named X and Y.

In the Untitled table I created an analysis using Fit Y by X and saved the script to a data table.

Capture.JPG

There should be nothing in this script that is specific to the data table.

Now I right-click on the script in the table panel and choose copy.

Switch over to Untitled 2. Go to the table panel, right-click and choose Paste.Capture.JPG

Clicking the green "run" triangle will provide the same graph on this new data table.

So in order to best help, perhaps we will need to know about the script you are using since there must be SOMETHING that refers to that specific data table.

 

Dan Obermiller
mhd7
Level II

Re: using the same script in multiple data tables

Your example makes sense and it is what I would think would happen. I'll post the script below and some screen shots. Question: Does the source matter - can the two sheets come from different locations or should they all be in the same location(folder)?

 

I am copying script for "Training session by species" from "Kate" and pasting it to "Danielle":

mhd7_0-1588020865854.png

 

 

 

mhd7_2-1588021012325.png

 

So it is showing up but when I hit "run" nothing happens (at least this time it did not take me back to "Kate's" sheet)

 

Thank you for your help!

 

mhd7
Level II

Re: using the same script in multiple data tables

So, I just closed everything down, brought up the two reports and tried again - and it worked!! I guess I will have to blame this one on the computer this time around- though it is generally operator error. 

Thank you so very much for your fast responses!