cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
anne_sa
Level VI

How to know if a table is a linked subset?

Hello everybody,

 

I would like to determine (using JSL) if the current data table is linked to a main table or not.

I tried "<< Get Table Variable Names" but it didn't work.

Do you have any idea of how we can get this information?

 

Thanks in advance for your help!

24 REPLIES 24
hogi
Level XII

Re: How to know if a table is a linked subset?

Wonderful

 

Will you add a functionality to cut the link?
functionality to cut the connection between a linked table and the main table 

Re: How to know if a table is a linked subset?

@hogi - Now that is a different request. From my understanding, the linkage is created (or not) at the time of table creation. That one is still being investigated. 

Craige_Hales
Super User

Re: How to know if a table is a linked subset?

Cutting the link means cloning the rows the subset table is sharing from the main table. The request of unlinking dtA could be prototyped with

  • use tables->subset to make a full copy of dtA into dtB
  • close dtA
  • rename dtB to dtA's name

which is imperfect because any platforms open on dtA lose their connection to the data. It might turn out to be quite a bit of C++ code for a fairly small set of use-cases.  @anne_sa  does explain a use case that might benefit. But that seems to open a different can-of-worms: suddenly add-in_1's linked table is no longer linked because add-in_2 unlinked it. I'm inclined to think being able to ask about the link status to decide if a clone is needed might be the sweet spot here.

Craige
hogi
Level XII

Re: How to know if a table is a linked subset?

If I try to concatenate tables with the option Append to first table,

the script stops with the message:

 

 

Cannot append to table: Big Class. Possible reasons for this include: the table is locked, the table is in a platform with a by group, or there is a linked subset of the table. in access or evaluation of 'Concatenate' , Concatenate(/*###*/Data Table( "Subset of Big Class" ),	Append to first table)

 

 

The error message was very helpful to identify the issue.
But how to make the script robust against linked subsets?

An addition function:

dt << get list of linked subsets()

will help. Then I can close the subsets via JSL.

 

Alternatives:

  • Jmp updates the linked data tables
  • Jmp cuts the link automatically
  • concatenate get a new option: Jmp_is_allowed_to_close_linked_data_tables_if_this_is_needed_to_run_this_concatenate(1) 

 

 

hogi
Level XII

Re: How to know if a table is a linked subset?

It's not easy to keep all the linked subsets and the reports "alive" when data is sorted or added.
The simplest solution:  prevent a user from sorting a table, adding rows, or concatenating tables when linked subsets or reports are open. *)

 

From a user's perspective:
I hope it can be optimized in a future version of JMP.

 

Did your script crash or did you get stuck by error messages like 

hogi_0-1725099139687.png   hogi_1-1725099148753.png

... then please vote:
Sort data table + add rows + concatenate -> make it possible 

 

*)
with a inked subset:
sort → no

add rows → no

concatenate → no

 

with an open report:

sort → no

add rows → yes (!)

concatenate → yes (!)

 

with a linked summary tables:

sort → no [why does SORT not "cut the link"?!?]

add rows → yes²

concatenate → yes²

² JMP automatically cuts the link:

hogi_0-1725179686639.png