<?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: isolating the smallest date difference in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/isolating-the-smallest-date-difference/m-p/749569#M93001</link>
    <description>&lt;P&gt;Just to extend a little on&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/37319"&gt;@WebDesignesCrow&lt;/a&gt;&amp;nbsp;interactive solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't already have the difference column, you can create it interactively (select both of your dates, right click on the column header and find Difference (reverse order). This will create a new column where the differences are in seconds. If you want to see them in yours/days you can double click on the created column and modify it as needed (such as add division by In Days(1)) but seconds work for this case&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1714020133160.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63665i2D64690AE033A295/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1714020133160.png" alt="jthi_1-1714020133160.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then right click on this new column's header and make absolute value column out of it&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_5-1714020507585.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63669iD78F271647016F58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_5-1714020507585.png" alt="jthi_5-1714020507585.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After you have that column, right click on the subjectid column and make it grouping column&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_3-1714020241035.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63667i0A6A505949B9C46F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_3-1714020241035.png" alt="jthi_3-1714020241035.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;next you can right click on the date difference column and create rank formula (note the grouping)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_8-1714020609139.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63672i6EFE859A98E6FED2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_8-1714020609139.png" alt="jthi_8-1714020609139.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;from the final column, right click on one of the "ones", select matching cells&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_7-1714020569347.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63671i9B7C42A6E6C6B5D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_7-1714020569347.png" alt="jthi_7-1714020569347.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;From here you can either create subset using selected rows&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_9-1714020648045.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63673iD0B74C6D4618D42D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_9-1714020648045.png" alt="jthi_9-1714020648045.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;OR right click on the row list, invert selection and after inversion delete rows&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_10-1714020672795.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63674i426C0D6243725712/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_10-1714020672795.png" alt="jthi_10-1714020672795.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_11-1714020685944.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63675i503CBD89E6BA3633/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_11-1714020685944.png" alt="jthi_11-1714020685944.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_12-1714020694899.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63676i112E6D8FD5E5548D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_12-1714020694899.png" alt="jthi_12-1714020694899.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then if you need to repeat this you can either make a workflow or capture the script from enhanced log&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is script created by Workflow builder. Only thing it is missing is opening the table as I don't have the table saved (and some column names are incorrect for the same reason) so I added table creation script (workflow is also attached).&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

//Custom Action - Create table 'Untitled 2'
dt = New Table("Untitled 2",
	Add Rows(6),
	Compress File When Saved(1),
	New Column("subj", Numeric, "Continuous", Format("Best", 12), Set Values([1, 1, 1, 2, 2, 2])),
	New Column("day1",
		Numeric,
		"Continuous",
		Format("m/d/y", 12),
		Input Format("m/d/y"),
		Set Values([3618432000, 3618432000, 3618432000, 3596486400, 3596486400, 3596486400])
	),
	New Column("day2",
		Numeric,
		"Continuous",
		Format("m/d/y", 12),
		Input Format("m/d/y"),
		Set Values([3600028800, 3618518400, 3634502400, 3624912000, 3650313600, 3716150400])
	)
);;

//New formula column: day2-day1
Data Table("Untitled 2") &amp;lt;&amp;lt; New Formula Column(
	Operation(Category("Combine"), "Difference (reverse order)"),
	Columns(:day1, :day2)
);

//New formula column: Abs[day2-day1]
Data Table("Untitled 2") &amp;lt;&amp;lt; New Formula Column(
	Operation(Category("Transform"), "Absolute Value"),
	Columns(:"day2-day1"n)
);

//New formula column: Rank[Abs[day2-day1]][subj]
Data Table("Untitled 2") &amp;lt;&amp;lt; New Formula Column(
	Operation(Category("Distributional"), "Rank"),
	Columns(:"Abs[day2-day1]"n),
	Group By(:subj)
);

//Select matching cells
Data Table("Untitled 2") &amp;lt;&amp;lt; Select Where(:"Rank[Abs[day2-day1]][subj]"n == 1);

//Subset data table
Data Table("Untitled 2") &amp;lt;&amp;lt; Select Where(:"Rank[Abs[day2-day1]][subj]"n == 1) &amp;lt;&amp;lt;
Subset(Selected Rows(1), Selected columns only(0));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Apr 2024 05:00:53 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-04-25T05:00:53Z</dc:date>
    <item>
      <title>isolating the smallest date difference</title>
      <link>https://community.jmp.com/t5/Discussions/isolating-the-smallest-date-difference/m-p/749512#M92996</link>
      <description>&lt;P&gt;i have a large dataset that has a static date on a subject (date of chest CT scan) and i need to find the smallest date difference and keep that row (delete the others).&amp;nbsp; jmp 16.2.0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example below - i want to keep rows 2 and 4 (the smallest day difference for subject 1 and 2).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;subj ID.&amp;nbsp; &amp;nbsp; CT date.&amp;nbsp; &amp;nbsp; &amp;nbsp; lung function date.&amp;nbsp; &amp;nbsp; &amp;nbsp; day difference&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8/30/18&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1/29/18&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -213&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8/30/18&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8/31/18&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8/30/18&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3/4/19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 186&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12/19/17&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;11/13/18&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 329&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12/19/17&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 9/3/19&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;623&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12/19/17&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10/4/21&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1385&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 22:27:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/isolating-the-smallest-date-difference/m-p/749512#M92996</guid>
      <dc:creator>jsolo01</dc:creator>
      <dc:date>2024-04-24T22:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: isolating the smallest date difference</title>
      <link>https://community.jmp.com/t5/Discussions/isolating-the-smallest-date-difference/m-p/749551#M92999</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/23793"&gt;@jsolo01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;How about adding a new formula column "Col Rank" to rank the day difference according to subj ID.?&lt;/P&gt;
&lt;P&gt;Then, you can select row "Col Rank" not equal to 0 &amp;amp; delete the rows.&lt;/P&gt;
&lt;P&gt;For;&lt;/P&gt;
&lt;P&gt;subj ID 1, the min day difference is the 2nd row.&lt;/P&gt;
&lt;P&gt;subj ID 2, the min day difference is the 4th row&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Create new formula column: Col Rank&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WebDesignesCrow_1-1714007353565.png" style="width: 873px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63657i64C39173F605A201/image-dimensions/873x227?v=v2" width="873" height="227" role="button" title="WebDesignesCrow_1-1714007353565.png" alt="WebDesignesCrow_1-1714007353565.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WebDesignesCrow_2-1714007436165.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63658i4DBBC0108B677DE3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WebDesignesCrow_2-1714007436165.png" alt="WebDesignesCrow_2-1714007436165.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Go to Rows &amp;gt; Row Selection &amp;gt; Select Where&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WebDesignesCrow_3-1714007503396.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63659iF5A14517BE094141/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WebDesignesCrow_3-1714007503396.png" alt="WebDesignesCrow_3-1714007503396.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3) Define the condition: Col Ran does not equal 1 &amp;gt; click "Add Condition"&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WebDesignesCrow_4-1714007638691.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63660i8337B760F06C114C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WebDesignesCrow_4-1714007638691.png" alt="WebDesignesCrow_4-1714007638691.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WebDesignesCrow_5-1714007657925.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63661i1C50C72FDC291B25/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WebDesignesCrow_5-1714007657925.png" alt="WebDesignesCrow_5-1714007657925.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4) Right click the selected rows &amp;gt; Delete Rows&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WebDesignesCrow_6-1714007730940.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63662iD4C529E787937FC5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WebDesignesCrow_6-1714007730940.png" alt="WebDesignesCrow_6-1714007730940.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5) Final result as below&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WebDesignesCrow_7-1714007750159.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63663i036B65855B42CBE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WebDesignesCrow_7-1714007750159.png" alt="WebDesignesCrow_7-1714007750159.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps.&lt;/P&gt;
&lt;P&gt;If it's a repetitive analysis, you can automate the steps through workflow or JSL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 01:16:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/isolating-the-smallest-date-difference/m-p/749551#M92999</guid>
      <dc:creator>WebDesignesCrow</dc:creator>
      <dc:date>2024-04-25T01:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: isolating the smallest date difference</title>
      <link>https://community.jmp.com/t5/Discussions/isolating-the-smallest-date-difference/m-p/749553#M93000</link>
      <description>&lt;P&gt;Here is my take on a simple way to get what you are asking for;&amp;nbsp; Just a simple script&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( :day difference == Col Min( :day difference, :subject ID ) );

dt &amp;lt;&amp;lt; subset( selected columns( 0 ), selected rows( 1 ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Apr 2024 01:54:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/isolating-the-smallest-date-difference/m-p/749553#M93000</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-04-25T01:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: isolating the smallest date difference</title>
      <link>https://community.jmp.com/t5/Discussions/isolating-the-smallest-date-difference/m-p/749569#M93001</link>
      <description>&lt;P&gt;Just to extend a little on&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/37319"&gt;@WebDesignesCrow&lt;/a&gt;&amp;nbsp;interactive solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't already have the difference column, you can create it interactively (select both of your dates, right click on the column header and find Difference (reverse order). This will create a new column where the differences are in seconds. If you want to see them in yours/days you can double click on the created column and modify it as needed (such as add division by In Days(1)) but seconds work for this case&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1714020133160.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63665i2D64690AE033A295/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1714020133160.png" alt="jthi_1-1714020133160.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then right click on this new column's header and make absolute value column out of it&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_5-1714020507585.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63669iD78F271647016F58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_5-1714020507585.png" alt="jthi_5-1714020507585.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;After you have that column, right click on the subjectid column and make it grouping column&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_3-1714020241035.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63667i0A6A505949B9C46F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_3-1714020241035.png" alt="jthi_3-1714020241035.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;next you can right click on the date difference column and create rank formula (note the grouping)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_8-1714020609139.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63672i6EFE859A98E6FED2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_8-1714020609139.png" alt="jthi_8-1714020609139.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;from the final column, right click on one of the "ones", select matching cells&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_7-1714020569347.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63671i9B7C42A6E6C6B5D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_7-1714020569347.png" alt="jthi_7-1714020569347.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;From here you can either create subset using selected rows&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_9-1714020648045.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63673iD0B74C6D4618D42D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_9-1714020648045.png" alt="jthi_9-1714020648045.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;OR right click on the row list, invert selection and after inversion delete rows&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_10-1714020672795.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63674i426C0D6243725712/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_10-1714020672795.png" alt="jthi_10-1714020672795.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_11-1714020685944.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63675i503CBD89E6BA3633/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_11-1714020685944.png" alt="jthi_11-1714020685944.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_12-1714020694899.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63676i112E6D8FD5E5548D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_12-1714020694899.png" alt="jthi_12-1714020694899.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then if you need to repeat this you can either make a workflow or capture the script from enhanced log&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is script created by Workflow builder. Only thing it is missing is opening the table as I don't have the table saved (and some column names are incorrect for the same reason) so I added table creation script (workflow is also attached).&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

//Custom Action - Create table 'Untitled 2'
dt = New Table("Untitled 2",
	Add Rows(6),
	Compress File When Saved(1),
	New Column("subj", Numeric, "Continuous", Format("Best", 12), Set Values([1, 1, 1, 2, 2, 2])),
	New Column("day1",
		Numeric,
		"Continuous",
		Format("m/d/y", 12),
		Input Format("m/d/y"),
		Set Values([3618432000, 3618432000, 3618432000, 3596486400, 3596486400, 3596486400])
	),
	New Column("day2",
		Numeric,
		"Continuous",
		Format("m/d/y", 12),
		Input Format("m/d/y"),
		Set Values([3600028800, 3618518400, 3634502400, 3624912000, 3650313600, 3716150400])
	)
);;

//New formula column: day2-day1
Data Table("Untitled 2") &amp;lt;&amp;lt; New Formula Column(
	Operation(Category("Combine"), "Difference (reverse order)"),
	Columns(:day1, :day2)
);

//New formula column: Abs[day2-day1]
Data Table("Untitled 2") &amp;lt;&amp;lt; New Formula Column(
	Operation(Category("Transform"), "Absolute Value"),
	Columns(:"day2-day1"n)
);

//New formula column: Rank[Abs[day2-day1]][subj]
Data Table("Untitled 2") &amp;lt;&amp;lt; New Formula Column(
	Operation(Category("Distributional"), "Rank"),
	Columns(:"Abs[day2-day1]"n),
	Group By(:subj)
);

//Select matching cells
Data Table("Untitled 2") &amp;lt;&amp;lt; Select Where(:"Rank[Abs[day2-day1]][subj]"n == 1);

//Subset data table
Data Table("Untitled 2") &amp;lt;&amp;lt; Select Where(:"Rank[Abs[day2-day1]][subj]"n == 1) &amp;lt;&amp;lt;
Subset(Selected Rows(1), Selected columns only(0));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 05:00:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/isolating-the-smallest-date-difference/m-p/749569#M93001</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-25T05:00:53Z</dc:date>
    </item>
  </channel>
</rss>

