<?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 detele the same data in the table？ in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51570#M29237</link>
    <description>&lt;P&gt;I just started from scratch and it worked on my end. Tried both MIn() and Max() and it gave what I was expecting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did notice a couple of things:&lt;/P&gt;&lt;P&gt;1. When I told you I added column 1, I forgot to mentioned I initialized it to sequential numeric. IE I basically replicated the row number.&lt;/P&gt;&lt;P&gt;2. Noticed you use the brackets around the table name, and the table name ends in "$". Those are MS take on SQL. Try eliminating those.&lt;/P&gt;&lt;P&gt;3. Can't remember if I told you to hit the update button in the custom sql window or not, but seems to help me before I run query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2018 01:46:10 GMT</pubDate>
    <dc:creator>rwright</dc:creator>
    <dc:date>2018-02-20T01:46:10Z</dc:date>
    <item>
      <title>HOW to delete the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51310#M29090</link>
      <description>&lt;P&gt;dear，&lt;/P&gt;
&lt;P&gt;&amp;nbsp;every time i go to menu which “row” to detele&amp;nbsp; the same data ，&lt;/P&gt;
&lt;P&gt;i&amp;nbsp; want to delete the same data in&amp;nbsp; the table automaticly， and&amp;nbsp; i don t know to how&amp;nbsp; to write JSL &amp;nbsp;&lt;/P&gt;
&lt;P&gt;how i do to write ？&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 18:38:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51310#M29090</guid>
      <dc:creator>TONYMA</dc:creator>
      <dc:date>2018-02-15T18:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51322#M29097</link>
      <description>&lt;P&gt;Assuming there is some condition you can write to select the data you want to delete, check out Select Where() in the scripting&amp;nbsp;index.&lt;/P&gt;&lt;P&gt;e.g.:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; Select Where( :Col1 == "A") &amp;lt;&amp;lt; Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This would delete any rows in Col1 with the value "A".&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 15:47:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51322#M29097</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-02-15T15:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51386#M29129</link>
      <description>&lt;P&gt;thanks，&lt;/P&gt;
&lt;P&gt;but &amp;nbsp; if i&amp;nbsp; refresh data&amp;nbsp; ， i can not delete the same data automatic which below to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
dt &amp;lt;&amp;lt; Select Where( :Col1 == "A") &amp;lt;&amp;lt; Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 18:39:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51386#M29129</guid>
      <dc:creator>TONYMA</dc:creator>
      <dc:date>2018-02-15T18:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51390#M29130</link>
      <description>&lt;P&gt;Please clarify.&amp;nbsp; I am confused.&amp;nbsp; In the data table you attached, you have 2 columns, "first" and "second".&amp;nbsp; If you want to delete the rows based upon finding the value of "A" in the column named "first" the JSL would be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

dt &amp;lt;&amp;lt; Select Where( :first == "A") &amp;lt;&amp;lt; Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you wanted to delete rows based upon the value of "A" being in the column named "second", the JSL would be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

dt &amp;lt;&amp;lt; Select Where( :second == "A") &amp;lt;&amp;lt; Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So when you say "&lt;SPAN&gt;but &amp;nbsp; if i&amp;nbsp; refresh data "........are you indicating, that when you reopen the data table?&amp;nbsp; Are you expecting the JSL to be automatically re-executed when you open the data table again?&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 15:27:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51390#M29130</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-15T15:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51434#M29161</link>
      <description>&lt;P&gt;thanks，&lt;/P&gt;&lt;P&gt;the &lt;SPAN&gt;data table&amp;nbsp; comes from database，and everytime i open it，&amp;nbsp; the data is refreshed 。&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;so&amp;nbsp; i expect&amp;nbsp;&lt;SPAN&gt;the JSL to be automatically re-executed to delete&amp;nbsp; the&amp;nbsp; same&amp;nbsp; data&amp;nbsp; appear in the table。&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Please clarify.&amp;nbsp; I am confused.&amp;nbsp; In the data table you attached, you have 2 columns, "first" and "second".&amp;nbsp; If you want to delete the rows based upon finding the value of "A" in the column named "first" the JSL would be:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

dt &amp;lt;&amp;lt; Select Where( :first == "A") &amp;lt;&amp;lt; Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you wanted to delete rows based upon the value of "A" being in the column named "second", the JSL would be:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();

dt &amp;lt;&amp;lt; Select Where( :second == "A") &amp;lt;&amp;lt; Delete Rows;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So when you say "&lt;SPAN&gt;but &amp;nbsp; if i&amp;nbsp; refresh data "........are you indicating, that when you reopen the data table?&amp;nbsp; Are you expecting the JSL to be automatically re-executed when you open the data table again?&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;data&amp;nbsp; when i open the data table again。&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 05:50:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51434#M29161</guid>
      <dc:creator>TONYMA</dc:creator>
      <dc:date>2018-02-16T05:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51439#M29164</link>
      <description>&lt;P&gt;When you open the data from the database, you will have to add the JSL to the script that you use for retrieving the data.&amp;nbsp; What method are you using for getting the data from the database?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2018 10:03:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51439#M29164</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-16T10:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51502#M29197</link>
      <description>&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;I use ”Built Query“of JMP menu to get data from database，&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;When you open the data from the database, you will have to add the JSL to the script that you use for retrieving the data.&amp;nbsp; What method are you using for getting the data from the database?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 05:00:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51502#M29197</guid>
      <dc:creator>TONYMA</dc:creator>
      <dc:date>2018-02-18T05:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51503#M29198</link>
      <description>&lt;P&gt;The JMP Query Builder lets you add JSL to the query.&amp;nbsp; Look at the documentation on Page 121 in&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Help==&amp;gt;Books==&amp;gt;Using JMP&lt;/P&gt;
&lt;P&gt;It will allow you to add to your query the code to automatically delete the desired rows, every time you extract the data.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 05:38:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51503#M29198</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-02-18T05:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51511#M29201</link>
      <description>&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;attached file with excel "Solubility" is original data which i want to modify&lt;/P&gt;&lt;P&gt;attached file"data.dsn" is database&lt;/P&gt;&lt;P&gt;the result which i want to be&amp;nbsp; is&amp;nbsp; atteched excel named "delete"&amp;nbsp;&lt;/P&gt;&lt;P&gt;I write “ SELECT distinct [LOT NO],code,[abnormal content] FROM [Solubility$]”&lt;/P&gt;&lt;P&gt;to delete the same data which in "LOT NO"&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it can not worked .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2018 09:07:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51511#M29201</guid>
      <dc:creator>TONYMA</dc:creator>
      <dc:date>2018-02-19T09:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51561#M29229</link>
      <description>&lt;P&gt;Your problem is that you are using DISTINCT across all columns of solubility. Because for LOT NO 1700002, you have unique values (ie 'elec break', 'pin hole') in column abnormal content, you keep getting the same rows back because each row is unique on the set of columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I remember correctly, Excel (ie M$) sql has a FIRST or LAST version, SAS (ie JMP) does not (although that might have changed under current versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's code I wrote that seems to answer your question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT t2.*&lt;/P&gt;&lt;P&gt;FROM Solubility&amp;nbsp; t2&lt;/P&gt;&lt;P&gt;WHERE t2."Column 1" IN (&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT DISTINCT t1."Column 1"&lt;/P&gt;&lt;P&gt;FROM Solubility&amp;nbsp; t1&amp;nbsp;&lt;/P&gt;&lt;P&gt;GROUP BY t1."LOT NO"&lt;/P&gt;&lt;P&gt;HAVING t1."Column 1" = Max(t1."Column 1"));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I opened Solubility into JMP&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added a column, Column 1 (think of this as a Sort/Order column)&lt;/P&gt;&lt;P&gt;Next I went into SQL Query builder under tables&lt;/P&gt;&lt;P&gt;After Picking Solublity as table, I picked "column 1", and "lot no", which I'm going to use in a coorelated sub-query (ie a temporary table), and checked DISTINCT Rows only, and clicked add&lt;/P&gt;&lt;P&gt;Now I clicked the triangle next to query Name and chose Convert to Sql. This will let me write the code (30 years of SAS - click and point only get you so far).&lt;/P&gt;&lt;P&gt;I editted the code to what I gave you above, ran the query, corrected any errors that came up, until it ran right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I matched your modified solubility on column 1 on the correlated subquery mentioned above. The subquery returns unique "column 1"s by taking the maximum column 1 of each group of "lot no". I'm using Max() here as a subsitute for last. Min() could be used as a substitute for FIRST.&lt;/P&gt;&lt;P&gt;I could have also done this as a JOIN on the subquery as another table. We'll leave that for tomorrow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know this is probably pretty esoteric, but if you have any questions let me know, Ill try to answer them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RCW&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>Mon, 19 Feb 2018 22:02:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51561#M29229</guid>
      <dc:creator>rwright</dc:creator>
      <dc:date>2018-02-19T22:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51563#M29231</link>
      <description>Made slight mistake - using Min will return your "delete" table.</description>
      <pubDate>Mon, 19 Feb 2018 22:16:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51563#M29231</guid>
      <dc:creator>rwright</dc:creator>
      <dc:date>2018-02-19T22:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51564#M29232</link>
      <description>&lt;P&gt;I went ahead and redid it by putting subquery as table so you can see difference. Sometimes one way works better or is clearer than the other. Here the "t1" and "t2" are aliases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT t1.*&lt;/P&gt;&lt;P&gt;FROM Solubility t1,&lt;/P&gt;&lt;P&gt;( SELECT DISTINCT "LOT NO", Min("Column 1") AS "Column 1" FROM Solubility GROUP BY "LOT NO" ) AS t2&lt;/P&gt;&lt;P&gt;WHERE t1."Column 1" = t2."Column 1"&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2018 22:43:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51564#M29232</guid>
      <dc:creator>rwright</dc:creator>
      <dc:date>2018-02-19T22:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51568#M29235</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am sorry to tell you that it can not work&lt;/P&gt;&lt;P&gt;the alarm is &lt;A href="http://www.baidu.com/link?url=fmAFh3G8uHQ0tNfCL46rmtxgsrE8-zqEJ3PlZ718nxoHkutunGEELXkQgazI_I7DjtBoG6-2-7SgVhB-ECRzpWXxn2o4JEIpB_3SQ5m6MwsenyrbSbC8nckM66rE_NQy" target="_blank"&gt;circular &lt;/A&gt;&lt;A href="http://www.baidu.com/link?url=fmAFh3G8uHQ0tNfCL46rmtxgsrE8-zqEJ3PlZ718nxoHkutunGEELXkQgazI_I7DjtBoG6-2-7SgVhB-ECRzpWXxn2o4JEIpB_3SQ5m6MwsenyrbSbC8nckM66rE_NQy" target="_blank"&gt;reference&lt;/A&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SELECT t1.*&lt;BR /&gt;FROM [Solubility$] t1,&lt;BR /&gt;( SELECT DISTINCT "LOT NO", &lt;U&gt;&lt;STRONG&gt;Min("Column 1") as "Column 1"&lt;/STRONG&gt; &lt;/U&gt;FROM [Solubility$] GROUP BY "LOT NO" ) AS t2&lt;BR /&gt;WHERE t1."Column 1" = t2."Column 1"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 00:56:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51568#M29235</guid>
      <dc:creator>TONYMA</dc:creator>
      <dc:date>2018-02-20T00:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: HOW to detele the same data in the table？</title>
      <link>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51570#M29237</link>
      <description>&lt;P&gt;I just started from scratch and it worked on my end. Tried both MIn() and Max() and it gave what I was expecting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did notice a couple of things:&lt;/P&gt;&lt;P&gt;1. When I told you I added column 1, I forgot to mentioned I initialized it to sequential numeric. IE I basically replicated the row number.&lt;/P&gt;&lt;P&gt;2. Noticed you use the brackets around the table name, and the table name ends in "$". Those are MS take on SQL. Try eliminating those.&lt;/P&gt;&lt;P&gt;3. Can't remember if I told you to hit the update button in the custom sql window or not, but seems to help me before I run query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 01:46:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/HOW-to-delete-the-same-data-in-the-table/m-p/51570#M29237</guid>
      <dc:creator>rwright</dc:creator>
      <dc:date>2018-02-20T01:46:10Z</dc:date>
    </item>
  </channel>
</rss>

