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
pauldeen
Level VI

How do I get only the rows of a data table (without headers) into a journal with JSL

At the end of a scripted analysis I would like to get my datatable into the journal. Since it is a template file import from excel, the column names are meaningless so I would like to not see those in the journal. Any way to dump just the rows and column contents, without the column names into the journal?

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: How do I get only the rows of a data table (without headers) into a journal with JSL

dt = Open( "$sample_data/big class.jmp" );
table = dt << GetAsReport;
(table << XPath( "//TableBox/*" )) << SetHeading( "" );
table << Journal;

Extending your idea: Use GetAsReport to operate on the tree before journaling it. Then broadcast the SetHeading to all the table box children that XPath returns. Table is a display box tree that can be used in a NewWindow(...) or journaled.

Add a table to a journal without the column headers.Add a table to a journal without the column headers.

Craige

View solution in original post

2 REPLIES 2
pauldeen
Level VI

Re: How do I get only the rows of a data table (without headers) into a journal with JSL

This bit of code will do it, but is there a more elegant solution? It makes the header dissapear only on the last table in the journal.

current data table() << journal;
current data table() << journal;
current data table() << journal;
TableNumber = n items(Current Journal() <<xpath("//TableBox"));
boxes = Current Journal()[TableBox(TableNumber)] <<xpath("//StringColBox");
For(i=1, i<= nitems(boxes), i++,
	boxes[i] << set heading("")
);
boxes = Current Journal()[TableBox(TableNumber)] <<xpath("//NumberColBox");
For(i=1, i<= nitems(boxes), i++,
	boxes[i] << set heading("")
);

 

Craige_Hales
Super User

Re: How do I get only the rows of a data table (without headers) into a journal with JSL

dt = Open( "$sample_data/big class.jmp" );
table = dt << GetAsReport;
(table << XPath( "//TableBox/*" )) << SetHeading( "" );
table << Journal;

Extending your idea: Use GetAsReport to operate on the tree before journaling it. Then broadcast the SetHeading to all the table box children that XPath returns. Table is a display box tree that can be used in a NewWindow(...) or journaled.

Add a table to a journal without the column headers.Add a table to a journal without the column headers.

Craige