How can I get a hierarchy of all open data tables:
- subsets
- stacked / split table
- summary table
something like the tree structure in the main menu - or in the window list?
in my last approach, I use @jthi 's trick to parse the enhanced log :
talk to enhanced log
But maybe, there is a more clever approach, hacking the window list view?
Unfortunately:
... and the window list ist not listed in get Window List()
Or specify data tables in the Get Window List() function?
Names Default To Here( 1 );
open_tables = Get Window List( Type( "Data Tables" ) ) << Get Window Title;
Or
Names Default To Here( 1 );
open_tables = Get Data Table List();
I know both function, but I did not know that they can be used to get the hierarchy of open data tables.
From the returned lists, how can I find out which table is a subset or summary of another data table?
Facing the same issue showing windows in the forthcoming new Assistant. Currently just looking at the names and parsing on " - ".
Unfortunately, from the window name, one cannot conclude if the tables are linked or separate.
I submitted the question to JMP support : TS-00278736
the suggestion : submit the idea to the wish list.
done: GetOpenTableDependencyGraph() and others
For reports it is a bit easier as you can use << Get Data Table (annoying part is getting the platform reference). Oversimplified examples
get_reference_table_window = Function({reportwindow}, {Default Local},
table = Empty();
tablelist = Get Data Table List() << get name;
window_title = reportwindow << Get Window Title;
table = Empty(); // one should definitely match...
For Each({tablename}, tablelist,
If(Starts With(window_title, tablename),
table = Datatable(tablename);
break;
);
);
return(table);
);
get_reference_table_helpkey = Function({reportwindow}, {Default Local},
table = Empty();
// look for OutlineBoxes with helpKey xml attribute
obs = reportwindow << XPath("//OutlineBox[@helpKey]"); // can run out of depth, could also loop over outlineboxes
objs = obs << Get Scriptable Object;
For Each({obj}, objs,
If(Is Empty(obj),
continue();
);
sobj = obj << Get Scriptable Object;
If(!Is Empty(sobj),
table = sobj << Get Data Table;
);
);
return(table);
);
For data tables it does get more messy and can only rely on name and source table script for non-linked tables. For linked tables you have some more involved strategies you can try.