<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Column Switcher selection to dynamically label column in data table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Column-Switcher-selection-to-dynamically-label-column-in-data/m-p/958425#M110151</link>
    <description>&lt;P&gt;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.&amp;nbsp; See the Scripting Index for a description of and example of the Make Column Switch Handler.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jul 2026 01:55:35 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2026-07-14T01:55:35Z</dc:date>
    <item>
      <title>Column Switcher selection to dynamically label column in data table</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Switcher-selection-to-dynamically-label-column-in-data/m-p/958402#M110150</link>
      <description>&lt;P&gt;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.&amp;nbsp; It should also "unlabel" any previously labeled data table columns no longer selected within the Column Switcher.&amp;nbsp; Is there a way this can be accomplished?&amp;nbsp; I am using JMP version 19.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2026 20:36:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Switcher-selection-to-dynamically-label-column-in-data/m-p/958402#M110150</guid>
      <dc:creator>ashwint27</dc:creator>
      <dc:date>2026-07-13T20:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Column Switcher selection to dynamically label column in data table</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Switcher-selection-to-dynamically-label-column-in-data/m-p/958425#M110151</link>
      <description>&lt;P&gt;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.&amp;nbsp; See the Scripting Index for a description of and example of the Make Column Switch Handler.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2026 01:55:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Switcher-selection-to-dynamically-label-column-in-data/m-p/958425#M110151</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2026-07-14T01:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Column Switcher selection to dynamically label column in data table</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Switcher-selection-to-dynamically-label-column-in-data/m-p/958657#M110158</link>
      <description>&lt;P&gt;Thanks Jim.&amp;nbsp; 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:&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Process Measurements.jmp" );
gb = Graph Builder( Variables( Y( :Process 1 ) ), Elements( Histogram( Y, Legend( 3 ) ) ) );

dt &amp;lt;&amp;lt; Clear Column Selection();

columnSwitcher = gb &amp;lt;&amp;lt; Column Switcher(
	:Process 1,
	{:Process 1, :Process 2, :Process 3, :Process 4, :Process 5, :Process 6, :Process 7}
);


dt &amp;lt;&amp;lt; Set Label Columns();
dt &amp;lt;&amp;lt; Set Label Columns( :Process 1 );


pre = Function( {currentColumn, nextColumn, switcher},
	Print(
		"Before switch: " || (currentColumn &amp;lt;&amp;lt; get name) || " &amp;gt;&amp;gt; " || (nextColumn &amp;lt;&amp;lt; get name) ||
		" [Column Switcher] current: " || (columnSwitcher &amp;lt;&amp;lt; Get Current)
	);
	currentColumn &amp;lt;&amp;lt; Label( 1 );
);
post = Function( {previousColumn, currentColumn, switcher},
	Print(
		"After switch: " || (previousColumn &amp;lt;&amp;lt; get name) || " &amp;gt;&amp;gt; " || (currentColumn &amp;lt;&amp;lt; get name) ||
		" [Column Switcher] current: " || (columnSwitcher &amp;lt;&amp;lt; Get Current)
	);
	previousColumn &amp;lt;&amp;lt; Label( 0 );
	currentColumn &amp;lt;&amp;lt; Label( 1 );
);
handler = columnSwitcher &amp;lt;&amp;lt; Make Column Switch Handler( pre, post );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Jul 2026 21:16:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Switcher-selection-to-dynamically-label-column-in-data/m-p/958657#M110158</guid>
      <dc:creator>ashwint27</dc:creator>
      <dc:date>2026-07-14T21:16:28Z</dc:date>
    </item>
  </channel>
</rss>

