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

How could Workflow Builder automatically recognize the table newly created Untitle1 vs. Untitle 2?

When I am creating the workflow, I may use tabulate to create some summary table and it is automatically named as "Untitle 1". As a result, when I excuting the Workflow again, the newly created summary table is named as "Untitle 2" so workflow cannot find Untilte1 and I need to manually give it a reference and mistakes happens a lot if there are a lot of new tables.

Is there any way we could let Workflow automatically recognize the new table? Or, could we directly name the table in Tabulate before "make it into table" "Untitle"?

 

Thanks!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: How could Workflow Builder automatically recognize the table newly created Untitle1 vs. Untitle 2?

You can decide the name when using Tabulate, but I think you have to do it by modifying the JSL (add Output Table("tablename") to << Make Into Data Table)

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Car Poll.jmp");
obj = dt << Tabulate(
	Add Table(
		Column Table(Grouping Columns(:sex, :marital status)),
		Row Table(Grouping Columns(:country, :size))
	)
);
dt = obj << Make Into Data Table(Output Table("My Table"));
-Jarmo

View solution in original post

hogi
Level XII

Re: How could Workflow Builder automatically recognize the table newly created Untitle1 vs. Untitle 2?

Workflow Builder is great - the user doesn't need to know any JSL scripting.

... till he is confronted with the trap: table name conflicts.
In 50% of the cases, there is no table with matching name - and JMP will ask.
The issue starts, IF there is a table with matching name, and it's the wrong one.

 

The topic is dicussed in the Q&A of this talk:
Workflow Builder or the "baby steps" into Scripting 

 

There are several "workarounds":

The easiest one (#4b) - following  @jthi example:
use a bit of JSL and store the table references as "dt". Then use dt also in all the other workflow steps.

NB: Specifying "Output Table" just works till there is a collision, then "Untitled" will be "Untitled 2".

 

other approaches:

#1 use the rewind icon

hogi_0-1724069630374.png

... to close all data tables, then the newly generated table will again be "Untitled".
-> no robust solution
The approach will fail once there is an open data table Untitled and the user tries to run the workflow.


#2: save
after creating the data table, save it with a specific name. Use the saved data table to record the additional steps.
Cool: With Save, even if there is a table name conflict - JMP won't add a "2".
Just use every time the same temporary file and overwrite it.
Not nice - but very effective!!
@Zoe_Betteridgein Using-JMP-Workflow-Builder-to-Automate-Analysis

 

#3: new since JMP18: use the for each loop
It replaces all table names in nested workflow steps with the table name from the import step (also works for N=1):

https://community.jmp.com/t5/Benelux-JMP-Users-Group/Workflow-Builder-or-the-quot-baby-steps-quot-in...

 

 

#4: with a bit of JSL: in all workflow steps, remove the table name references

// for workflow steps like
// Data Table("mytable") << command (...);
// just remove the data table and get:
command( ... )

[unfortunately, there are several exceptions where this approach will fail].

 

#4b: change the code and use a variable as reference for the data table
import step:

// add "dt ="
dt = open( ...);

subsequent worklow steps:

// replace:
// Data Table("mytable") << command (...)
// with

dt << command( ...)

 

 

I hope, in a future version of JMP there will be a Workflow Builder which automatically prevents the user from getting into this trap, e.g.

  • once a data table is created, Worklow Builder could ask for a suitable variable name to reference the data table.
  • a button in Workflow Builder:
    replace Data Table reference by table name -> Data Table reference by variable

View solution in original post

3 REPLIES 3
jthi
Super User

Re: How could Workflow Builder automatically recognize the table newly created Untitle1 vs. Untitle 2?

You can decide the name when using Tabulate, but I think you have to do it by modifying the JSL (add Output Table("tablename") to << Make Into Data Table)

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Car Poll.jmp");
obj = dt << Tabulate(
	Add Table(
		Column Table(Grouping Columns(:sex, :marital status)),
		Row Table(Grouping Columns(:country, :size))
	)
);
dt = obj << Make Into Data Table(Output Table("My Table"));
-Jarmo
hogi
Level XII

Re: How could Workflow Builder automatically recognize the table newly created Untitle1 vs. Untitle 2?

Workflow Builder is great - the user doesn't need to know any JSL scripting.

... till he is confronted with the trap: table name conflicts.
In 50% of the cases, there is no table with matching name - and JMP will ask.
The issue starts, IF there is a table with matching name, and it's the wrong one.

 

The topic is dicussed in the Q&A of this talk:
Workflow Builder or the "baby steps" into Scripting 

 

There are several "workarounds":

The easiest one (#4b) - following  @jthi example:
use a bit of JSL and store the table references as "dt". Then use dt also in all the other workflow steps.

NB: Specifying "Output Table" just works till there is a collision, then "Untitled" will be "Untitled 2".

 

other approaches:

#1 use the rewind icon

hogi_0-1724069630374.png

... to close all data tables, then the newly generated table will again be "Untitled".
-> no robust solution
The approach will fail once there is an open data table Untitled and the user tries to run the workflow.


#2: save
after creating the data table, save it with a specific name. Use the saved data table to record the additional steps.
Cool: With Save, even if there is a table name conflict - JMP won't add a "2".
Just use every time the same temporary file and overwrite it.
Not nice - but very effective!!
@Zoe_Betteridgein Using-JMP-Workflow-Builder-to-Automate-Analysis

 

#3: new since JMP18: use the for each loop
It replaces all table names in nested workflow steps with the table name from the import step (also works for N=1):

https://community.jmp.com/t5/Benelux-JMP-Users-Group/Workflow-Builder-or-the-quot-baby-steps-quot-in...

 

 

#4: with a bit of JSL: in all workflow steps, remove the table name references

// for workflow steps like
// Data Table("mytable") << command (...);
// just remove the data table and get:
command( ... )

[unfortunately, there are several exceptions where this approach will fail].

 

#4b: change the code and use a variable as reference for the data table
import step:

// add "dt ="
dt = open( ...);

subsequent worklow steps:

// replace:
// Data Table("mytable") << command (...)
// with

dt << command( ...)

 

 

I hope, in a future version of JMP there will be a Workflow Builder which automatically prevents the user from getting into this trap, e.g.

  • once a data table is created, Worklow Builder could ask for a suitable variable name to reference the data table.
  • a button in Workflow Builder:
    replace Data Table reference by table name -> Data Table reference by variable
hogi
Level XII

Re: How could Workflow Builder automatically recognize the table newly created Untitle1 vs. Untitle 2?

Based on Option 4b, there is a post in the wish list to fix the issue automatically:

Allow Action Recorder to use simple variable names as references