<?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: How to Select If Column Contains a Specific Value Else Do Nothing in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-Select-If-Column-Contains-a-Specific-Value-Else-Do/m-p/68629#M34882</link>
    <description>&lt;P&gt;That worked great! Thank you for the help!&lt;/P&gt;</description>
    <pubDate>Fri, 17 Aug 2018 16:38:53 GMT</pubDate>
    <dc:creator>Sully</dc:creator>
    <dc:date>2018-08-17T16:38:53Z</dc:date>
    <item>
      <title>How to Select If Column Contains a Specific Value Else Do Nothing</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-If-Column-Contains-a-Specific-Value-Else-Do/m-p/68550#M34869</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to write a select statement for a column where if the column does not contain a desired value it will do nothing but if the column does contain the value I am&amp;nbsp;looking for I can have it perform additional scripting?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a column Notification Code that contains 3 values "1-Addition", "3-Update", and "4-Delete" that is among my transactional data. When the table is updated and there happens to be a "4-Delete" in the column I&amp;nbsp;currently subset the data and then match/update&amp;nbsp;it back to the original file in order to determine the first instance (i.e the Addition or Update) and delete both records of the transaction&amp;nbsp;out of the table. Today is the first instance where the data was updated and didn't contain a 4-Delete. This caused my select and delete statement to delete all records out of the table. Example of current JSL for Select and Delete below:&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;rowchoice = dt3 &amp;lt;&amp;lt; Get Rows Where (:Notification Code == "4-Delete");
dt3 &amp;lt;&amp;lt; Select Rows (rowchoice);
subdt1 = dt3 &amp;lt;&amp;lt; Subset(
       Link to Original Data Table (0),
       Rows(),
       Output Table Name ("Deletions")
       );
      
subdt1.2 = Current Data Table ();
subdt1.2 &amp;lt;&amp;lt; Delete Column (:N Rows);
subdt1.2 &amp;lt;&amp;lt; New Column ("Deletions", Numeric, Continous,
&amp;lt;&amp;lt; set each value(1)
);
 
dt3 &amp;lt;&amp;lt; Update (
       With (Data Table ("Deletions")),
       Match Columns (:ROL Case # == :ROL Case #, :"Card/Account Number" == :"Card/Account Number"),
       Selected (:Deletions)
);
 
Close(subdt1.2, No Save);
rowchoice = dt3 &amp;lt;&amp;lt; get rows where (:Deletions == 1);
dt3 &amp;lt;&amp;lt; Select Rows(rowchoice);
dt3 &amp;lt;&amp;lt; Delete Rows (rowchoice);
dt3 &amp;lt;&amp;lt; Delete Column (:Deletions);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 14:22:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-If-Column-Contains-a-Specific-Value-Else-Do/m-p/68550#M34869</guid>
      <dc:creator>Sully</dc:creator>
      <dc:date>2018-08-17T14:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select If Column Contains a Specific Value Else Do Nothing</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-If-Column-Contains-a-Specific-Value-Else-Do/m-p/68573#M34872</link>
      <description>&lt;P&gt;From what I can tell, the following will work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; 
rowchoice = dt3 &amp;lt;&amp;lt; Get Rows Where (:Notification Code == "4-Delete");
If( N Rows( rowchoice ) &amp;gt; 0,
dt3 &amp;lt;&amp;lt; Select Rows (rowchoice);
subdt1 = dt3 &amp;lt;&amp;lt; Subset(
       Link to Original Data Table (0),
       Rows(),
       Output Table Name ("Deletions")
       );
      
subdt1.2 = Current Data Table ();
subdt1.2 &amp;lt;&amp;lt; Delete Column (:N Rows);
subdt1.2 &amp;lt;&amp;lt; New Column ("Deletions", Numeric, Continous,
&amp;lt;&amp;lt; set each value(1)
);
 
dt3 &amp;lt;&amp;lt; Update (
       With (Data Table ("Deletions")),
       Match Columns (:ROL Case # == :ROL Case #, :"Card/Account Number" == :"Card/Account Number"),
       Selected (:Deletions)
);
 
Close(subdt1.2, No Save);
rowchoice = dt3 &amp;lt;&amp;lt; get rows where (:Deletions == 1);
dt3 &amp;lt;&amp;lt; Select Rows(rowchoice);
dt3 &amp;lt;&amp;lt; Delete Rows (rowchoice);
dt3 &amp;lt;&amp;lt; Delete Column (:Deletions);
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Aug 2018 15:17:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-If-Column-Contains-a-Specific-Value-Else-Do/m-p/68573#M34872</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-08-17T15:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Select If Column Contains a Specific Value Else Do Nothing</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Select-If-Column-Contains-a-Specific-Value-Else-Do/m-p/68629#M34882</link>
      <description>&lt;P&gt;That worked great! Thank you for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 16:38:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Select-If-Column-Contains-a-Specific-Value-Else-Do/m-p/68629#M34882</guid>
      <dc:creator>Sully</dc:creator>
      <dc:date>2018-08-17T16:38:53Z</dc:date>
    </item>
  </channel>
</rss>

