cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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

Recommended Articles