<?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 How do I create a new table avoiding duplicates. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745382#M92529</link>
    <description>&lt;P&gt;In JMP Pro 16.0&amp;nbsp; I have a table with three columns and multiple rows. The columns are named: ID, Amount and Results. The ID values are Characters whereas the Amounts and Results values are numbers. In some cases the ID is one unique id-code for example 3333. In some cases the same ID for example 3334 is duplicated in several rows and each row has their unique values of Amount and Results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a new table where I would like to include the unique id-codes including the values for Amount and Results. However, if there are duplicate ID-codes I would like to include only ID, Amount and Results with the ID with the lowest value of Amount as well as the Results value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate very much for how I should do that. I am at advanced amateur level and know how to write JSL scripts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely yours&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lars Enochsson&lt;/P&gt;&lt;P&gt;Professor of Surgery&lt;/P&gt;&lt;P&gt;Karolinska Institutet&lt;/P&gt;&lt;P&gt;Stockholm,&lt;/P&gt;&lt;P&gt;Sweden&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2024 12:58:12 GMT</pubDate>
    <dc:creator>LarsBirger</dc:creator>
    <dc:date>2024-04-09T12:58:12Z</dc:date>
    <item>
      <title>How do I create a new table avoiding duplicates.</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745382#M92529</link>
      <description>&lt;P&gt;In JMP Pro 16.0&amp;nbsp; I have a table with three columns and multiple rows. The columns are named: ID, Amount and Results. The ID values are Characters whereas the Amounts and Results values are numbers. In some cases the ID is one unique id-code for example 3333. In some cases the same ID for example 3334 is duplicated in several rows and each row has their unique values of Amount and Results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a new table where I would like to include the unique id-codes including the values for Amount and Results. However, if there are duplicate ID-codes I would like to include only ID, Amount and Results with the ID with the lowest value of Amount as well as the Results value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate very much for how I should do that. I am at advanced amateur level and know how to write JSL scripts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely yours&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lars Enochsson&lt;/P&gt;&lt;P&gt;Professor of Surgery&lt;/P&gt;&lt;P&gt;Karolinska Institutet&lt;/P&gt;&lt;P&gt;Stockholm,&lt;/P&gt;&lt;P&gt;Sweden&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 12:58:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745382#M92529</guid>
      <dc:creator>LarsBirger</dc:creator>
      <dc:date>2024-04-09T12:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a new table avoiding duplicates.</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745386#M92530</link>
      <description>&lt;P&gt;Please see the documentation for the &lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/summarize-columns.shtml#" target="_self"&gt;Tables &amp;gt; Summary&lt;/A&gt; command. You can simply ask for the Minimum value by ID.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 13:32:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745386#M92530</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2024-04-09T13:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a new table avoiding duplicates.</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745388#M92531</link>
      <description>&lt;P&gt;Hello Lars,&lt;/P&gt;
&lt;P&gt;In response to your question- while this could be done with scripting, it is not necessary.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A column formula can create an indicator.&amp;nbsp; From this select matching, where the Flag=1.&amp;nbsp; Then&amp;nbsp;&lt;U&gt;Tables&lt;/U&gt; menu&amp;gt; &lt;U&gt;Subset&lt;/U&gt;, selected rows....&lt;BR /&gt;I will use sample data file Big Class, with "Age" as an ID that has duplicates.&amp;nbsp; This is a ordinal value, but the same formula will work with characters.&lt;/P&gt;
&lt;P&gt;We will flag the Minimum "Height" within the group of similar "age" in a similar way that you are looking for the minimum "amount" per "ID"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GregF_JMP_0-1712669921406.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63209i601DC9C9573EA03F/image-size/large?v=v2&amp;amp;px=999" role="button" title="GregF_JMP_0-1712669921406.png" alt="GregF_JMP_0-1712669921406.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;These steps could be recorded with workflow builder in order to make a script.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 13:43:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745388#M92531</guid>
      <dc:creator>GregF_JMP</dc:creator>
      <dc:date>2024-04-09T13:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a new table avoiding duplicates.</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745392#M92533</link>
      <description>&lt;P&gt;Thank you for the swift answer. However, it did not completely solve the problem. The thing is that if I have a table like this&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Amount&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Results&lt;/P&gt;&lt;P&gt;John&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;/P&gt;&lt;P&gt;George&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;43&lt;/P&gt;&lt;P&gt;George&amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;24&lt;/P&gt;&lt;P&gt;George&amp;nbsp; &amp;nbsp; &amp;nbsp; 15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;32&lt;/P&gt;&lt;P&gt;Matt&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 60&lt;/P&gt;&lt;P&gt;Matt&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;70&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 35&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a new table with the unique ID as well as with the lowest amount and the corresponding Results number. The new table should look like this&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Amount&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Results&lt;/P&gt;&lt;P&gt;John&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20&lt;/P&gt;&lt;P&gt;George&amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;43&lt;/P&gt;&lt;P&gt;Matt&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 60&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely yours&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lars&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 13:53:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745392#M92533</guid>
      <dc:creator>LarsBirger</dc:creator>
      <dc:date>2024-04-09T13:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a new table avoiding duplicates.</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745400#M92534</link>
      <description>&lt;P&gt;An alternative (not necessarily easier but might be and does not require scripting) is to use Tabulate with ID as the row and using minimum Amount in the body of the table.&amp;nbsp; Then Make into Data Table and then join that back to the original table, dropping multiples in the with table but bringing in the column for Results.&amp;nbsp; In the Join Tables, match on both the ID and the Amount columns.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 14:21:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745400#M92534</guid>
      <dc:creator>dlehman1</dc:creator>
      <dc:date>2024-04-09T14:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a new table avoiding duplicates.</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745417#M92536</link>
      <description>&lt;P&gt;Here is a little script that seems to do what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

dt &amp;lt;&amp;lt; select where( :amount == Col Min( :amount, :id ) );

dtFinal = dt &amp;lt;&amp;lt; subset(
	selected rows( 1 ),
	selected columns( 0 ),
	output table( "Final" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1712673961776.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63214i28D0038532093450/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1712673961776.png" alt="txnelson_0-1712673961776.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2024 14:46:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-create-a-new-table-avoiding-duplicates/m-p/745417#M92536</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-04-09T14:46:09Z</dc:date>
    </item>
  </channel>
</rss>

