<?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, Local Data Filter and Ref Line Automatically Update in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/325099#M57455</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I've copied that into a script it doesn't appear to work correctly. The graph has an error message stating 'Graphics script reported errors in log'. And the error reported in the log states 'Name Unresolved: weight{21} in access or evaluation of 'weight' , weight/*###*/'. I'm using JMP 13, I don't know if this may be an issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've managed to add a reference line which remains at 1.333 regardless of what is displayed on the y-axis as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj = dt_sum &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 464 ),
	Show Control Panel( 0 ),
	Variables(
	X( :Feature ID, Order By( :Cpk, Ascending, Order Statistic( "Mean" ) ) ),
	Y( :Cpk)
	),
	Column Switcher( :Cpk, {: Cpk, :Ppk}),
	Elements( Bar( X, Y, Legend( 4 ) ) ),
	);

Report(obj)[FrameBox(1)] &amp;lt;&amp;lt; 
	Add Graphics Script(
		1, Description( "Pen Script"),
		Pen Color("red");
		Pen Size(3);
		Y Function(1.333, Feature ID);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However I'm still unsure how to link the column switcher with a local data filter so that only values below a certain y-value are displayed and updated when the column is switched.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2020 15:13:05 GMT</pubDate>
    <dc:creator>Vicki36</dc:creator>
    <dc:date>2020-10-22T15:13:05Z</dc:date>
    <item>
      <title>Column Switcher, Local Data Filter and Ref Line Automatically Update</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/324936#M57435</link>
      <description>&lt;P&gt;I have created a bar chart using the graph builder and want to apply a local data filter, column switcher and ref line to the chart. Is it possible to automatically switch the local data filter and reference line depending on which column is selected. At the moment my reference line just completed disappears when I swap between columns. I have 2 possible columns to select, Cpk and Ppk. I want to include a reference line at Cpk = 1.333 and Ppk = 1.333, respective of which is currently being displayed. Similarly, I want to add a local data filter to show only values between the min Cpk/Ppk value and a max value of 1.5 depending on which column is being displayed. Is it possible to do this in the simple graph builder by scripting it or will I need to look in to a dashboard/application? This is what I currently have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Graph Builder(
	Size( 534, 464 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Feature ID, Order By( :Cpk , Ascending, Order Statistic( "Mean" ) ) ),
		Y( :Cpk )
	),
	Column Switcher( :Cpk , {: Cpk , :Ppk }),
	Elements( Bar( X, Y, Legend( 4 ) ) ),
	Local Data Filter(
		Add Filter( columns( :Cpk ), Where( :Cpk &amp;gt;= floor(Col Min(:Cpk )) &amp;amp; :Cpk &amp;lt;= 1.5 ) )
	),
	SendToReport(
		Dispatch(
			{},
			"Cpk ",
			ScaleBox,
			{Add Ref Line( 1.333, "Solid", "Red", "", 3 )}
		),
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:07:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/324936#M57435</guid>
      <dc:creator>Vicki36</dc:creator>
      <dc:date>2023-06-11T11:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Column Switcher, Local Data Filter and Ref Line Automatically Update</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/325094#M57452</link>
      <description>&lt;P&gt;Yes it is possible to do what you want.&amp;nbsp; Here is a simple example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);

ColSwitcher = gb &amp;lt;&amp;lt; Column switcher( :weight, {:weight, :height} );

Report( gb )[framebox( 1 )] &amp;lt;&amp;lt; add graphics script(
	theCol = ColSwitcher &amp;lt;&amp;lt; Get Current;
	If(
		theCol == "weight",
			Report( gb )[AxisBox( 2 )] &amp;lt;&amp;lt; add ref line(
				Col Mean( :weight ),
				"solid",
				red,
				"Mean",
				2
			),
		theCol == "height",
			Report( gb )[AxisBox( 2 )] &amp;lt;&amp;lt; add ref line(
				Col Mean( :height ),
				"solid",
				red,
				"Mean",
				2
			)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 14:44:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/325094#M57452</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-10-22T14:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Column Switcher, Local Data Filter and Ref Line Automatically Update</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/325099#M57455</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I've copied that into a script it doesn't appear to work correctly. The graph has an error message stating 'Graphics script reported errors in log'. And the error reported in the log states 'Name Unresolved: weight{21} in access or evaluation of 'weight' , weight/*###*/'. I'm using JMP 13, I don't know if this may be an issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've managed to add a reference line which remains at 1.333 regardless of what is displayed on the y-axis as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj = dt_sum &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 464 ),
	Show Control Panel( 0 ),
	Variables(
	X( :Feature ID, Order By( :Cpk, Ascending, Order Statistic( "Mean" ) ) ),
	Y( :Cpk)
	),
	Column Switcher( :Cpk, {: Cpk, :Ppk}),
	Elements( Bar( X, Y, Legend( 4 ) ) ),
	);

Report(obj)[FrameBox(1)] &amp;lt;&amp;lt; 
	Add Graphics Script(
		1, Description( "Pen Script"),
		Pen Color("red");
		Pen Size(3);
		Y Function(1.333, Feature ID);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However I'm still unsure how to link the column switcher with a local data filter so that only values below a certain y-value are displayed and updated when the column is switched.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 15:13:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/325099#M57455</guid>
      <dc:creator>Vicki36</dc:creator>
      <dc:date>2020-10-22T15:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Column Switcher, Local Data Filter and Ref Line Automatically Update</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/325346#M57460</link>
      <description>The first issue with running the script in JMP 13, is that what is returned from the &lt;BR /&gt;     ColSwitcher &amp;lt;&amp;lt; get Current&lt;BR /&gt;is not a literal string, so it has to be changed to &lt;BR /&gt;     char( ColSwitcher &amp;lt;&amp;lt; get Current )&lt;BR /&gt;but when one does that, JMP goes into an infinite loop&lt;BR /&gt;I believe this was a known error, and is related to the when the Add Graphics Script is called by the Column Switcher change.&lt;BR /&gt;I tried a bunch of things, but wasn't able to come up with a solution.  Upgrading to 15 is the only option I am sure will fix it.</description>
      <pubDate>Thu, 22 Oct 2020 16:42:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/325346#M57460</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-10-22T16:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Column Switcher, Local Data Filter and Ref Line Automatically Update</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/325832#M57509</link>
      <description>Ok thank you no worries!&lt;BR /&gt;&lt;BR /&gt;I'm using company software so don't think I'll be able to upgrade so will just have to think of a different way to display the data. I assume I will run into a similar problem if trying to just change the axis limits depending on the column selected, rather than trying to update the local data filter? Cheers</description>
      <pubDate>Fri, 23 Oct 2020 13:38:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Switcher-Local-Data-Filter-and-Ref-Line-Automatically/m-p/325832#M57509</guid>
      <dc:creator>Vicki36</dc:creator>
      <dc:date>2020-10-23T13:38:38Z</dc:date>
    </item>
  </channel>
</rss>

