<?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: creating Filter Col Selector with options from expressions (dynamically) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/creating-Filter-Col-Selector-with-options-from-expressions/m-p/847909#M102284</link>
    <description>&lt;P&gt;Are you looking for something like this? There is an ifbox which is set to 0 by default in filter col box, you can set it to 1 to make the search box visible. Also you can just send send the message &amp;lt;&amp;lt; Name Contains to your filter col box instead of building it inside (usually easier to manage this way).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Arrhythmia.jmp");// case with filter
filt = "interval";

fcs = Filter Col Selector(dt, , width(250), nlines(30));
Eval(EvalExpr(fcs &amp;lt;&amp;lt; Name contains(Expr(filt))));

fcs[IfBox(1)] &amp;lt;&amp;lt; Set(1);

nw = New Window("Filter Col Selector Example", &amp;lt;&amp;lt; modal,
	fcs
);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 14 Mar 2025 17:16:30 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-03-14T17:16:30Z</dc:date>
    <item>
      <title>creating Filter Col Selector with options from expressions (dynamically)</title>
      <link>https://community.jmp.com/t5/Discussions/creating-Filter-Col-Selector-with-options-from-expressions/m-p/847899#M102283</link>
      <description>&lt;P&gt;My goal is to create a&amp;nbsp;Filter Col Selector in a modal window that applies a default "name contains" filter if one is given to the function. However, in the case where input to the function has a blank filter, it leaves open the filterbox so user is ready to input a filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is example result of desired output if input was blank, vs "interval"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );&lt;BR /&gt;dtex = Open( "$SAMPLE_DATA/Arrhythmia.jmp" );&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;// case with filter
filt = "interval";
eval(eval expr(
	New Window( "Filter Col Selector if filter option given", &amp;lt;&amp;lt;modal,  Filter Col Selector( dtex,  &amp;lt;&amp;lt; name contains(expr(filt)), width( 250 ), nlines(30) ) );
));

// case with no option --&amp;gt; FILTER SELECTION IS GONE, not desired result
filt = "";
eval(eval expr(
	New Window( "Filter Col Selector if no option", &amp;lt;&amp;lt;modal,  Filter Col Selector( dtex,  &amp;lt;&amp;lt; name contains(expr(filt)), width( 250 ), nlines(30) ) );
));&lt;BR /&gt;&lt;BR /&gt;// case with no option --&amp;gt; FILTER SELECTION stays, but how to make this dynamically based on the 'filt' value?&lt;BR /&gt;filt = "";&lt;BR /&gt;eval(eval expr(&lt;BR /&gt;New Window( "Filter Col Selector if no option", &amp;lt;&amp;lt;modal, Filter Col Selector( dtex, width( 250 ), nlines(30) ) );&lt;BR /&gt;));&lt;BR /&gt;&lt;BR /&gt;// attempt to create with substitute do not work- cant use comma in expr to make multiple to insert...&lt;BR /&gt;testexpr = expr(new window("test", &amp;lt;&amp;lt;Modal, Filter Col Selector( current data table(), _OPTIONS_)););&lt;BR /&gt; if(filter != "",&lt;BR /&gt;_OPTIONS_ = eval expr(width(400), nlines(35), &amp;lt;&amp;lt;name contains(expr(default_list_filter)), &amp;lt;&amp;lt;continuous(0), &amp;lt;&amp;lt;Clear selection );&lt;BR /&gt;,&lt;BR /&gt;_OPTIONS_ = expr(width(400), nlines(35), &amp;lt;&amp;lt;continuous(0), &amp;lt;&amp;lt;Clear selection);&lt;BR /&gt;);&lt;BR /&gt;&lt;SPAN&gt; substitude into(testexpr , expr(_OPTIONS_), name expr(_OPTIONS_));&lt;/SPAN&gt;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I started down a rabbit hole of making the "name contains" into an expression that would optionally be added only to the case where a filter is applies - any ideas though on how to easily due this? I had substitute into the expression, but&amp;nbsp; this stalled when i needed to make a list instead...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;--Peach&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 17:00:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/creating-Filter-Col-Selector-with-options-from-expressions/m-p/847899#M102283</guid>
      <dc:creator>jetpeach</dc:creator>
      <dc:date>2025-03-14T17:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: creating Filter Col Selector with options from expressions (dynamically)</title>
      <link>https://community.jmp.com/t5/Discussions/creating-Filter-Col-Selector-with-options-from-expressions/m-p/847909#M102284</link>
      <description>&lt;P&gt;Are you looking for something like this? There is an ifbox which is set to 0 by default in filter col box, you can set it to 1 to make the search box visible. Also you can just send send the message &amp;lt;&amp;lt; Name Contains to your filter col box instead of building it inside (usually easier to manage this way).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Arrhythmia.jmp");// case with filter
filt = "interval";

fcs = Filter Col Selector(dt, , width(250), nlines(30));
Eval(EvalExpr(fcs &amp;lt;&amp;lt; Name contains(Expr(filt))));

fcs[IfBox(1)] &amp;lt;&amp;lt; Set(1);

nw = New Window("Filter Col Selector Example", &amp;lt;&amp;lt; modal,
	fcs
);

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Mar 2025 17:16:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/creating-Filter-Col-Selector-with-options-from-expressions/m-p/847909#M102284</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-03-14T17:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: creating Filter Col Selector with options from expressions (dynamically)</title>
      <link>https://community.jmp.com/t5/Discussions/creating-Filter-Col-Selector-with-options-from-expressions/m-p/847918#M102287</link>
      <description>&lt;P&gt;thanks a bunch! I had tried to send a message exactly as you mentioned, but thought because I had a model window that I couldn't actually do that.&lt;/P&gt;&lt;P&gt;however, i see you built the filter col selector first, then create the modal window last - simple, i just hadn't thought of that. perfect, thank you&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 17:43:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/creating-Filter-Col-Selector-with-options-from-expressions/m-p/847918#M102287</guid>
      <dc:creator>jetpeach</dc:creator>
      <dc:date>2025-03-14T17:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: creating Filter Col Selector with options from expressions (dynamically)</title>
      <link>https://community.jmp.com/t5/Discussions/creating-Filter-Col-Selector-with-options-from-expressions/m-p/847919#M102288</link>
      <description>&lt;P&gt;You can either build it before (I would do this) but you can also send the messages inside the new window and it should work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Arrhythmia.jmp");// case with filter
filt = "interval";

nw = New Window("Filter Col Selector Example", &amp;lt;&amp;lt; modal,
	fcs = Filter Col Selector(dt, , width(250), nlines(30)),
	
	Eval(EvalExpr(fcs &amp;lt;&amp;lt; Name contains(Expr(filt))));
	fcs[IfBox(1)] &amp;lt;&amp;lt; Set(1);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 18:00:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/creating-Filter-Col-Selector-with-options-from-expressions/m-p/847919#M102288</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-03-14T18:00:13Z</dc:date>
    </item>
  </channel>
</rss>

