<?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: Data filter script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11246#M10785</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One further question about the local data filter in your example:&lt;/P&gt;&lt;P&gt;How can you remove the filter by code ("remove local data filter" if you do it manually)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried these commands:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// works&lt;/P&gt;&lt;P&gt;ldf &amp;lt;&amp;lt; clear;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// does not work&lt;/P&gt;&lt;P&gt;ldf &amp;lt;&amp;lt; close;&lt;/P&gt;&lt;P&gt;ldf &amp;lt;&amp;lt; remove;&lt;/P&gt;&lt;P&gt;ldf &amp;lt;&amp;lt; close window;&lt;/P&gt;&lt;P&gt;ldf &amp;lt;&amp;lt; delete;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 May 2015 14:17:18 GMT</pubDate>
    <dc:creator>cis_pete</dc:creator>
    <dc:date>2015-05-08T14:17:18Z</dc:date>
    <item>
      <title>Data filter script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11239#M10778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;I am filtering data using values in a column. Is it possible to attach a script to the data filter so that the script runs whenever the a new column value is selected in the filter?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 14:12:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11239#M10778</guid>
      <dc:creator>wr</dc:creator>
      <dc:date>2015-03-03T14:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: Data filter script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11240#M10779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data filter manipulates the row states of the data table (global filter) or a private set of row states (local filter).&amp;nbsp; You can use dt&amp;lt;&amp;lt;Make RowState Handler(function) to perform actions on global filter changes, or box&amp;lt;&amp;lt;Make RowState Handler(function) for a local data filter.&amp;nbsp; Since there can be multiple local filters in a window, the box just needs to be within the report of interest, for example (platform &amp;lt;&amp;lt; Report) would work fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 14:05:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11240#M10779</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2015-03-04T14:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data filter script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11241#M10780</link>
      <description>&lt;P&gt;Building on Dan's reply, try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-size: 12px; font-family: Courier; color: #032ce4;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);
 
// Some data
dt = New Table( "Fruits",
  Add Rows( 3 ),
  New Column( "Fruit",
  Character,
  "Nominal",
  Set Values( {"Pear", "Apple", "Orange"} )
  )
  );

// A report with a local data filter
gb = dt &amp;lt;&amp;lt; Graph Builder(
  Size( 528, 448 ),
  Show Control Panel( 0 ),
  Show Legend( 0 ),
  Variables( X( :Fruit ) ),
  Elements( Bar( X, Legend( 3 ) ) ),
  Local Data Filter( Mode, Add Filter( columns( :Fruit ) ) )
  );
 
// Row state handler function
doSomethingWithSelection = Function({x}, {Default Local}, Beep(); Wait(0.1); Beep() );
 
// Get a reference to the report
gbReport = gb &amp;lt;&amp;lt; Report;
 
// See what messages the data filter display box understands (prints to the log)
ShowProperties(gbReport[OutlineBox(1)]);
 
// Assign the row state handler to the local data filter display box
rsh = gbReport[OutlineBox(1)] &amp;lt;&amp;lt; MakeRowStateHandler(doSomethingWithSelection);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="font-size: 12px; font-family: Courier;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 20:11:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11241#M10780</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2018-06-22T20:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Data filter script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11242#M10781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brilliant - thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 13:07:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11242#M10781</guid>
      <dc:creator>wr</dc:creator>
      <dc:date>2015-03-10T13:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Data filter script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11243#M10782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a similar problem. I would like to store the script of a local data filter of a graph builder in a string variable every time the filter changes. My problem with the script above is how to access the local data filter in the doSomethingWithSelection function.&lt;/P&gt;&lt;P&gt;The following line does not work, it does not give the data filter script: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;string = gbreport&lt;STRONG&gt;[&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #0000dd;"&gt;outlinebox&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: teal;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;)]&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt; &lt;STRONG style="color: navy; font-size: 10.0pt; font-family: 'Courier New';"&gt;get script&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 09:59:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11243#M10782</guid>
      <dc:creator>cis_pete</dc:creator>
      <dc:date>2015-05-08T09:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Data filter script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11244#M10783</link>
      <description>&lt;P&gt;To message the local data filter, you need to get a reference to it. Try something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-size: 12px; font-family: Courier; color: #032ce4;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);
 
// Some data
dt = New Table( "Fruits",
  Add Rows( 3 ),
  New Column( "Fruit",
  Character,
  "Nominal",
  Set Values( {"Pear", "Apple", "Orange"} )
  )
  );
 
// A report with a local data filter
gb = dt &amp;lt;&amp;lt; Graph Builder(
  Size( 528, 448 ),
  Show Control Panel( 0 ),
  Show Legend( 0 ),
  Variables( X( :Fruit ) ),
  Elements( Bar( X, Legend( 3 ) ) )
  );
ldf = gb &amp;lt;&amp;lt; Local Data Filter( Mode, Add Filter( columns( :Fruit ) ) );
 
// Row state handler function
doSomethingWithSelection = Function({x}, {Default Local},
  currentScript = ldf &amp;lt;&amp;lt; getScript;
  ClearLog();
  Print(currentScript);
);
 
// Get a reference to the report
gbReport = gb &amp;lt;&amp;lt; Report;
 
// Assign the row state handler to the local data filter display box
rsh = gbReport[OutlineBox(1)] &amp;lt;&amp;lt; MakeRowStateHandler(doSomethingWithSelection);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="font-size: 12px; font-family: Courier;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 20:12:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11244#M10783</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2018-06-22T20:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data filter script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11245#M10784</link>
      <description>&lt;P&gt;Thank you, that works. It is really easy if you know how to do it&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My next question is probably also quite easy for you:&lt;/P&gt;
&lt;P&gt;I have a local data filter in an application. I want to set a row state handler for it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's my code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;DataFilter1 &amp;lt;&amp;lt; Add Filter(
                Columns(Eval(filter_parameter)),
                Display(Size( 100, 150 ),List Display)
);
// set OutlineCloseOrientation and title
ldfr = DataFilter1 &amp;lt;&amp;lt; report;
ldfr[Outline Box( 1 )] &amp;lt;&amp;lt; OutlineCloseOrientation( "Horizontal" );
ldfr[Outline Box( 1 )] &amp;lt;&amp;lt; Set Title("Filter");
 
// set row state handler - both versions do not work
DataFilter1 &amp;lt;&amp;lt; Make Row State Handler(DataFilter1_handler);
ldfr[Outline Box( 1 )] &amp;lt;&amp;lt; Make Row State Handler(DataFilter1_handler);
 
DataFilter1_handler = function({x},
    show("row state handler function");
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 20:13:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11245#M10784</guid>
      <dc:creator>cis_pete</dc:creator>
      <dc:date>2018-06-22T20:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Data filter script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11246#M10785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One further question about the local data filter in your example:&lt;/P&gt;&lt;P&gt;How can you remove the filter by code ("remove local data filter" if you do it manually)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried these commands:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// works&lt;/P&gt;&lt;P&gt;ldf &amp;lt;&amp;lt; clear;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// does not work&lt;/P&gt;&lt;P&gt;ldf &amp;lt;&amp;lt; close;&lt;/P&gt;&lt;P&gt;ldf &amp;lt;&amp;lt; remove;&lt;/P&gt;&lt;P&gt;ldf &amp;lt;&amp;lt; close window;&lt;/P&gt;&lt;P&gt;ldf &amp;lt;&amp;lt; delete;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 14:17:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11246#M10785</guid>
      <dc:creator>cis_pete</dc:creator>
      <dc:date>2015-05-08T14:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Data filter script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11247#M10786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both of your solutions will work, but you do need to assign the result to something:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #555555; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG style="text-decoration: underline;"&gt;rsh =&lt;/STRONG&gt; DataFilter1 &amp;lt;&amp;lt; Make Row State Handler(DataFilter1_handler);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #555555; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #555555; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;The row state handler is an object that is returned to you.&amp;nbsp; Since it wasn't stored anywhere it went away!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 14:49:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11247#M10786</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2015-05-08T14:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Data filter script</title>
      <link>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11248#M10787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In JMP 11, the &amp;lt;&amp;lt; close command would not have an effect on a filter that was visible.&amp;nbsp; Changes in JMP 12 have made this work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a workaround for JMP 11 you could use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gb &amp;lt;&amp;lt; Remove Local Data Filter;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 15:14:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-filter-script/m-p/11248#M10787</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2015-05-08T15:14:37Z</dc:date>
    </item>
  </channel>
</rss>

