cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hogi
Level XIII

Hierarchy of open Data Tables

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?

7 REPLIES 7
hogi
Level XIII

Re: Hierarchy of open Data Tables

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?

hogi_0-1770110918791.png

 



Unfortunately:

hogi_0-1770036244269.png

... and the window list ist not listed in get Window List()

mmarchandFSLR
Level VI

Re: Hierarchy of open Data Tables

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;
mmarchandFSLR
Level VI

Re: Hierarchy of open Data Tables

Or

Names Default To Here( 1 );
open_tables = Get Data Table List();
hogi
Level XIII

Re: Hierarchy of open Data Tables

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?

Re: Hierarchy of open Data Tables

Facing the same issue showing windows in the forthcoming new Assistant.    Currently just looking at the names and parsing on " - ".

hogi
Level XIII

Re: Hierarchy of open Data Tables

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 

jthi
Super User

Re: Hierarchy of open Data Tables

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.

-Jarmo

Recommended Articles