cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
Tavuk89
Level II

Hide columns script

I tried this script to hide column no.1,2,3 but it only select the columns without hiding them. What did i missed?

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
c= dt << Select Columns( [1.2.3] );
c << Hide;
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Hide columns script

To hide columns I think you have to hide them one by one so loop over that matrix rather than select the columns.If you have JMP16+ you can use For Each, otherwise change that to "normal" for-loop

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
col_idx = [1, 2, 3];

For Each({idx}, col_idx,
	Column(dt, idx) << Hide(1);
);

From scripting index:

jthi_0-1703663546001.png

jthi_1-1703663615698.png

 

-Jarmo

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Hide columns script

Try this

names default to here(1);
dt=current data table();

dt<<get selected columns;

for each( {col}, dt<<get selected columns,
	as column(col) << hide(0)
)
Jim
jthi
Super User

Re: Hide columns script

To hide columns I think you have to hide them one by one so loop over that matrix rather than select the columns.If you have JMP16+ you can use For Each, otherwise change that to "normal" for-loop

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
col_idx = [1, 2, 3];

For Each({idx}, col_idx,
	Column(dt, idx) << Hide(1);
);

From scripting index:

jthi_0-1703663546001.png

jthi_1-1703663615698.png

 

-Jarmo
TaraHaley
Level I

Re: Hide columns script

Thank you, I tried it and it works for me. I appreciate you, you saved my day. Please mark it as a solution.

Are you also a student like me, and struggling in essay writing? today I am Navigating the academic landscape with CustomWriting Their custom essay writing service, available 24/7, is a lifesaver. From complex assignments to tight deadlines, they handle it all with finesse. Trust me; this service is a game-changer!