cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

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

Hiding column group in JSL

In the manual interface, you can click on a column group and then hide/unhide all the columns in the group with a single click (or two/three clicks if the hidden state is mixed).

What is some simple JSL that accomplishes this same thing by script?

My attempts to script this all look squirrelly to me.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Hiding column group in JSL

Here is a script that works.  The current restriction is that it acts on the first group found, but that is an easy work around.

Names Default To Here( 1 );
dt = Current Data Table();

groupNames = dt << get column groups names;
group = dt << get column group( groupnames[1] ) << select;
For( i = 1, i <= N Items( group ), i++,
	dt:((dt << get selected columns)[i]) << hide( 1 )
);

Another community member may have a way to take the For() loop out of the code, but I was not able to find one.

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Hiding column group in JSL

Here is a script that works.  The current restriction is that it acts on the first group found, but that is an easy work around.

Names Default To Here( 1 );
dt = Current Data Table();

groupNames = dt << get column groups names;
group = dt << get column group( groupnames[1] ) << select;
For( i = 1, i <= N Items( group ), i++,
	dt:((dt << get selected columns)[i]) << hide( 1 )
);

Another community member may have a way to take the For() loop out of the code, but I was not able to find one.

Jim
john_madden
Level VI

Re: Hiding column group in JSL

Here's a complication: some of the columns in my groups derive from a virtual join. So when I perform a <<Get Column Group("groupname") on those particular groups, the list that results looks like this:

 

group = {:LocalColumnA, Referenced Column("ForeignColumnA", Referenced Column("ForeignColumnB", Reference(Column(:ForeignLinkReferenceColumnA), …}

and the group<<hide(1) action only succeeds on the local columns, not on the foreign (virtually joined) columns.

Yet when I do this in the manual interface, the virtually joined columns respond just fine to a manual Hide/Unhide menu selection.  Aaargh.

Recommended Articles