cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP Security Notice: CVE-2026-109618 and CVE-2026-109619

    JMP promptly initiated a review of its products, services, and relevant infrastructure for exposure to CVE-2026-109618 and CVE-2026-109619.

    Our assessment of JMP products has not identified exposure to these vulnerabilities. Where remediation was required within supporting environments, appropriate security updates and controls have been applied and validated.

    We have identified no evidence of successful exploitation or unauthorized access to JMP systems or customer information associated with these vulnerabilities.

    JMP continues to monitor the issue and relevant vendor guidance. No action is required by JMP customers at this time.

  • 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.

Discussions

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

Column Switcher selection to dynamically label column in data table

I am interested in utilizing the Column Switcher in Graph Builder to where I select a column within the Column Switcher, and it dynamically sets the corresponding data table's column as a "label" column.  It should also "unlabel" any previously labeled data table columns no longer selected within the Column Switcher.  Is there a way this can be accomplished?  I am using JMP version 19.

1 ACCEPTED SOLUTION

Accepted Solutions
ashwint27
Level III

Re: Column Switcher selection to dynamically label column in data table

Thanks Jim.  I adapted the example script in the Scripting Index for "Make Column Switch Handler" and this code seems to work for what I was looking for:

 
dt = Open( "$SAMPLE_DATA/Process Measurements.jmp" );
gb = Graph Builder( Variables( Y( :Process 1 ) ), Elements( Histogram( Y, Legend( 3 ) ) ) );

dt << Clear Column Selection();

columnSwitcher = gb << Column Switcher(
	:Process 1,
	{:Process 1, :Process 2, :Process 3, :Process 4, :Process 5, :Process 6, :Process 7}
);


dt << Set Label Columns();
dt << Set Label Columns( :Process 1 );


pre = Function( {currentColumn, nextColumn, switcher},
	Print(
		"Before switch: " || (currentColumn << get name) || " >> " || (nextColumn << get name) ||
		" [Column Switcher] current: " || (columnSwitcher << Get Current)
	);
	currentColumn << Label( 1 );
);
post = Function( {previousColumn, currentColumn, switcher},
	Print(
		"After switch: " || (previousColumn << get name) || " >> " || (currentColumn << get name) ||
		" [Column Switcher] current: " || (columnSwitcher << Get Current)
	);
	previousColumn << Label( 0 );
	currentColumn << Label( 1 );
);
handler = columnSwitcher << Make Column Switch Handler( pre, post );
 

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Column Switcher selection to dynamically label column in data table

Using a Make Column Switch Handler, you should be able to add the JSL required to make your required changes when the Column Switcher is used.  See the Scripting Index for a description of and example of the Make Column Switch Handler.

Jim
ashwint27
Level III

Re: Column Switcher selection to dynamically label column in data table

Thanks Jim.  I adapted the example script in the Scripting Index for "Make Column Switch Handler" and this code seems to work for what I was looking for:

 
dt = Open( "$SAMPLE_DATA/Process Measurements.jmp" );
gb = Graph Builder( Variables( Y( :Process 1 ) ), Elements( Histogram( Y, Legend( 3 ) ) ) );

dt << Clear Column Selection();

columnSwitcher = gb << Column Switcher(
	:Process 1,
	{:Process 1, :Process 2, :Process 3, :Process 4, :Process 5, :Process 6, :Process 7}
);


dt << Set Label Columns();
dt << Set Label Columns( :Process 1 );


pre = Function( {currentColumn, nextColumn, switcher},
	Print(
		"Before switch: " || (currentColumn << get name) || " >> " || (nextColumn << get name) ||
		" [Column Switcher] current: " || (columnSwitcher << Get Current)
	);
	currentColumn << Label( 1 );
);
post = Function( {previousColumn, currentColumn, switcher},
	Print(
		"After switch: " || (previousColumn << get name) || " >> " || (currentColumn << get name) ||
		" [Column Switcher] current: " || (columnSwitcher << Get Current)
	);
	previousColumn << Label( 0 );
	currentColumn << Label( 1 );
);
handler = columnSwitcher << Make Column Switch Handler( pre, post );
 

Recommended Articles