<?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 - Selecting all when there is no alternative value to where does not equal statement (=!) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192643#M41188</link>
    <description>&lt;P&gt;Just checking: why are you using a data filter object? Does the user have to interact for the sake of the script?&lt;/P&gt;</description>
    <pubDate>Thu, 11 Apr 2019 16:21:16 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2019-04-11T16:21:16Z</dc:date>
    <item>
      <title>Data Filter - Selecting all when there is no alternative value to where does not equal statement (=!)</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192623#M41185</link>
      <description>&lt;P&gt;Looking for some help to understand the behavior or a better way to script this.&lt;BR /&gt;&lt;BR /&gt;Writing a script to catch exceptions in the data. When version is GP but active is &lt;U&gt;&lt;EM&gt;not&lt;/EM&gt;&lt;/U&gt; X.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
df = dt &amp;lt;&amp;lt; Data Filter(
	Location( {138, 181} ),
	Add Filter(
		columns( :Active, :Version ),
		Where( :Active != "X" ),
		Where( :Version == "GP" )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then the rest of the script subsets that data and creates a tabulate from that subset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem I am encountering is when all rows have Active == X.&amp;nbsp; The filter is selecting all rows.&amp;nbsp; I suppose that's because it's not finding an alternative to X which is blank (not missing).&amp;nbsp; What's the best way to handle this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result of the above code:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMP Community Data Filter Behavior.png" style="width: 806px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16852i9A6E5437A009108D/image-size/large?v=v2&amp;amp;px=999" role="button" title="JMP Community Data Filter Behavior.png" alt="JMP Community Data Filter Behavior.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 14:31:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192623#M41185</guid>
      <dc:creator>BSwid</dc:creator>
      <dc:date>2019-04-11T14:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Data Filter - Selecting all when there is no alternative value to where does not equal statement (=!)</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192642#M41187</link>
      <description>&lt;P&gt;You could first check to see if the condition can be met:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;target rows = Current Data Table() &amp;lt;&amp;lt; Get Rows Where( :Active != "X" );

If( N Row( target Rows ),
   ...
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Apr 2019 16:19:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192642#M41187</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-04-11T16:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Data Filter - Selecting all when there is no alternative value to where does not equal statement (=!)</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192643#M41188</link>
      <description>&lt;P&gt;Just checking: why are you using a data filter object? Does the user have to interact for the sake of the script?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 16:21:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192643#M41188</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-04-11T16:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Data Filter - Selecting all when there is no alternative value to where does not equal statement (=!)</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192644#M41189</link>
      <description>&lt;P&gt;No need for the user to interface.&amp;nbsp; Just a novice stealing code after each step done manually and then constructing the code from those steps.&amp;nbsp; I assume there's a better way to do select the subset and create the subset table?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 17:56:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192644#M41189</guid>
      <dc:creator>BSwid</dc:creator>
      <dc:date>2019-04-11T17:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Data Filter - Selecting all when there is no alternative value to where does not equal statement (=!)</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192645#M41190</link>
      <description>&lt;P&gt;OK, it actually makes your scripting easier. No pesky human interaction involved!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data table message &lt;STRONG&gt;&amp;lt;&amp;lt; Select Where( Boolean&amp;nbsp;expression )&lt;/STRONG&gt; will do it all for you. The Boolean expression can be simple (e.g. &lt;STRONG&gt;:Age == 12&lt;/STRONG&gt;) or complex (e.g., &lt;STRONG&gt;:Age == 12 &amp;amp; :Sex == "F"&lt;/STRONG&gt;). Any function that returns a result that can be interpreted as a Boolean (i.e., 0 is false, not 0 is true) will work. This requirement means that you can use query functions such as &lt;STRONG&gt;Contains( source column, "target" )&lt;/STRONG&gt; for literal targets or &lt;STRONG&gt;Regex( source column, regex )&lt;/STRONG&gt; for patterns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you select the rows you want, then send the &lt;STRONG&gt;&amp;lt;&amp;lt; Subset()&lt;/STRONG&gt; message to extract the data.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 18:04:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/192645#M41190</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-04-11T18:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Data Filter - Selecting all when there is no alternative value to where does not equal statement (=!)</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/193325#M41369</link>
      <description>&lt;P&gt;This is very helpful. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up doing something like the following.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scripting question, Is there a better way do to it?&amp;nbsp; As in did I need the CLE_TL intermediate?&amp;nbsp; Or can it just be dt &amp;lt;&amp;lt; select where &amp;lt;&amp;lt; subset&amp;nbsp; on one line?&amp;nbsp; Is there a benefit to creating that CLE_TL object?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt = current data table();

shipPlant = "CLE";
shipMode = "truckloads";
subsetTable = "CLE_truckloads";

//filter
CLE_TL = dt &amp;lt;&amp;lt; select where(:TransportPlanningPt == shipPlant &amp;amp; :MODE == shipMode);

//subset
CLE_TL  &amp;lt;&amp;lt; Subset(
	Output Table( subsetTable ),
	Selected Rows( 1 ),
	Selected columns only( 0 )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 16:59:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/193325#M41369</guid>
      <dc:creator>BSwid</dc:creator>
      <dc:date>2019-04-17T16:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Data Filter - Selecting all when there is no alternative value to where does not equal statement (=!)</title>
      <link>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/193327#M41371</link>
      <description>&lt;P&gt;Quick note.&amp;nbsp; I used your suggestion to help with one analysis. On to the next.&amp;nbsp; That's why the coding doesn't match the screen shot.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2019 17:00:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Data-Filter-Selecting-all-when-there-is-no-alternative-value-to/m-p/193327#M41371</guid>
      <dc:creator>BSwid</dc:creator>
      <dc:date>2019-04-17T17:00:26Z</dc:date>
    </item>
  </channel>
</rss>

