<?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 Do &amp;quot;work&amp;quot; when you select an item in the Data Filter in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Do-quot-work-quot-when-you-select-an-item-in-the-Data-Filter/m-p/366223#M61591</link>
    <description>&lt;P&gt;I am having trouble figuring out how to do "work" when you select a item in the data filter. When i select a condition I would like the script to go to my Limits Table and then populate an expression that i use for a Graphics Script. This will change based on the "where" statement from the data filter. I don't know how to get the script to trigger this action or how do you delete it if i were to change to a different data filter selection. I apologize in advance as i don't have the entire script or a sample data table. If more information is needed I will try my best to get some.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Step 1: Go to the textbox with "Where" statement

Try( test = Report( gb1_S.2 )[Text Box( 5 )] &amp;lt;&amp;lt; Get Text );
graph = dt_lim &amp;lt;&amp;lt; Get Rows Where( Contains( test, :SPEC_COL_NAMES ) );

// Step 2: If a condition exists, populate the following

f1 = Column( dt_lim, "StartF" )[graph][1]; // x1 for a Marker and starting point for the line
f2 = Column( dt_lim, "StartF" )[graph][2]; // x2 for a Marker and starting point for the line
s1 = (Column( dt_lim, "LSL" )[graph])[1]; // y1 (LSL) for the Line
s2 = (Column( dt_lim, "USL" )[graph])[1]; // y2 (USL) for the Line

color = "Red";

test = Expr(
	
	graph_expr = Eval Insert(
		"\[Graph_Script = Expr(
			Marker Size( 6 );
			Marker( Marker State( 20 ), Color State( "^color^" ), {^f1^, ^s1^}, {^f2^, ^s2^} );
			Pen Color( "^color^" );
			Line( {^f1^, ^s1^}, {^f2^, ^s2^} );	
		)]\"	
	);

	Eval( Parse( graph_expr ) );
	
);
&lt;BR /&gt;&lt;BR /&gt;// Step 3: Execute the Graphics script&lt;BR /&gt;&lt;BR /&gt;Report( gb1_S.2 )[Framebox( 1 )] &amp;lt;&amp;lt; Add Graphics Script( Graph_Script );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 11 Jun 2023 11:11:49 GMT</pubDate>
    <dc:creator>Yngeinstn</dc:creator>
    <dc:date>2023-06-11T11:11:49Z</dc:date>
    <item>
      <title>Do "work" when you select an item in the Data Filter</title>
      <link>https://community.jmp.com/t5/Discussions/Do-quot-work-quot-when-you-select-an-item-in-the-Data-Filter/m-p/366223#M61591</link>
      <description>&lt;P&gt;I am having trouble figuring out how to do "work" when you select a item in the data filter. When i select a condition I would like the script to go to my Limits Table and then populate an expression that i use for a Graphics Script. This will change based on the "where" statement from the data filter. I don't know how to get the script to trigger this action or how do you delete it if i were to change to a different data filter selection. I apologize in advance as i don't have the entire script or a sample data table. If more information is needed I will try my best to get some.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Step 1: Go to the textbox with "Where" statement

Try( test = Report( gb1_S.2 )[Text Box( 5 )] &amp;lt;&amp;lt; Get Text );
graph = dt_lim &amp;lt;&amp;lt; Get Rows Where( Contains( test, :SPEC_COL_NAMES ) );

// Step 2: If a condition exists, populate the following

f1 = Column( dt_lim, "StartF" )[graph][1]; // x1 for a Marker and starting point for the line
f2 = Column( dt_lim, "StartF" )[graph][2]; // x2 for a Marker and starting point for the line
s1 = (Column( dt_lim, "LSL" )[graph])[1]; // y1 (LSL) for the Line
s2 = (Column( dt_lim, "USL" )[graph])[1]; // y2 (USL) for the Line

color = "Red";

test = Expr(
	
	graph_expr = Eval Insert(
		"\[Graph_Script = Expr(
			Marker Size( 6 );
			Marker( Marker State( 20 ), Color State( "^color^" ), {^f1^, ^s1^}, {^f2^, ^s2^} );
			Pen Color( "^color^" );
			Line( {^f1^, ^s1^}, {^f2^, ^s2^} );	
		)]\"	
	);

	Eval( Parse( graph_expr ) );
	
);
&lt;BR /&gt;&lt;BR /&gt;// Step 3: Execute the Graphics script&lt;BR /&gt;&lt;BR /&gt;Report( gb1_S.2 )[Framebox( 1 )] &amp;lt;&amp;lt; Add Graphics Script( Graph_Script );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:11:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Do-quot-work-quot-when-you-select-an-item-in-the-Data-Filter/m-p/366223#M61591</guid>
      <dc:creator>Yngeinstn</dc:creator>
      <dc:date>2023-06-11T11:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Do "work" when you select an item in the Data Filter</title>
      <link>https://community.jmp.com/t5/Discussions/Do-quot-work-quot-when-you-select-an-item-in-the-Data-Filter/m-p/366238#M61594</link>
      <description>&lt;P&gt;Check out Make Filter Change Handler from Scripting Index on how to trigger action when filter selection is changed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example from scripting index:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
dist = Distribution(Automatic Recalc(1), Continuous Distribution(Column(:POP)));
filter = dist &amp;lt;&amp;lt; Local Data Filter(Add Filter(columns(:Region)));
f = Function({a}, Print(a));
rs = filter &amp;lt;&amp;lt; Make Filter Change Handler(f);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Mar 2021 18:53:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Do-quot-work-quot-when-you-select-an-item-in-the-Data-Filter/m-p/366238#M61594</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-03-08T18:53:31Z</dc:date>
    </item>
  </channel>
</rss>

