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!
Wonderful :)
Will you add a functionality to cut the link?
functionality to cut the connection between a linked table and the main table
@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.
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
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.
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:
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
... 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: