<?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: Many to one Table Join in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696900#M88210</link>
    <description>&lt;P&gt;create virtual column ~ transform column:&lt;BR /&gt;&lt;BR /&gt;right click on one of the columns in the list and select row/row:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1699641593990.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58563i321AC98470009771/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1699641593990.png" alt="hogi_1-1699641593990.png" /&gt;&lt;/span&gt;&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>Fri, 10 Nov 2023 18:40:04 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-11-10T18:40:04Z</dc:date>
    <item>
      <title>Many to one Table Join</title>
      <link>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696852#M88203</link>
      <description>&lt;P&gt;Dear Sir/Madam,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables that I need joined&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Two requests:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Request 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1 has multiple entries per day&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timothy_forsyth_0-1699637111440.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58548i8B720A0B0C75F0FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timothy_forsyth_0-1699637111440.png" alt="timothy_forsyth_0-1699637111440.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2 has 1 entry per day&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timothy_forsyth_1-1699637249392.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58549iC82260EC48811F8A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timothy_forsyth_1-1699637249392.png" alt="timothy_forsyth_1-1699637249392.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to join the tables matching "Parameter Set Name and Timestamp"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to create a table like this.&amp;nbsp; How do I do that?&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timothy_forsyth_4-1699638072801.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58550i006B6CBD2D44AC0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timothy_forsyth_4-1699638072801.png" alt="timothy_forsyth_4-1699638072801.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Request 2)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Given the First two tables how do I join them so that for every given day I get only the last value for Parameter X as shown below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="timothy_forsyth_5-1699638336106.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58551i0F2CCE67AA16D3F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="timothy_forsyth_5-1699638336106.png" alt="timothy_forsyth_5-1699638336106.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts and suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, Timothy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 17:50:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696852#M88203</guid>
      <dc:creator>timothy_forsyth</dc:creator>
      <dc:date>2023-11-10T17:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Many to one Table Join</title>
      <link>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696869#M88204</link>
      <description>&lt;P&gt;Which JMP version you have? If you have JMP17 it is easiest to just have the tables open, go to Join tables menu and try out different options. Request 1 should be very simple join and for request 2 you might need to create Summary table before performing the join. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you are able to provide example tables for us (anonymized or mock-up works), we can provide you with more accurate instructions.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 17:53:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696869#M88204</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-10T17:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Many to one Table Join</title>
      <link>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696881#M88205</link>
      <description>&lt;P&gt;I&amp;nbsp; have JMP 16.&amp;nbsp; I did put mock up tables in my post.&amp;nbsp; Are you able to see them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 18:01:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696881#M88205</guid>
      <dc:creator>timothy_forsyth</dc:creator>
      <dc:date>2023-11-10T18:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Many to one Table Join</title>
      <link>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696885#M88206</link>
      <description>&lt;P&gt;Ok, if you have JMP16, you won't have access to preview tables, but you can enable "keep dialog open" option so if you mess something up, you still have the dialog open.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can see the images, but those aren't really tables as I cannot open them in JMP or I cannot bring the data into JMP. If you could add them as JMP tables, it would make it much easier.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 18:04:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696885#M88206</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-10T18:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Many to one Table Join</title>
      <link>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696887#M88207</link>
      <description>&lt;P&gt;For option 2 there is a dirty hack:&lt;/P&gt;&lt;P&gt;Join always takes the first matching entry.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So with the option&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1699639503549.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58556i5F50DFB0CD823EDA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1699639503549.png" alt="hogi_0-1699639503549.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- if you &lt;STRONG&gt;&lt;EM&gt;reverse&lt;/EM&gt;&amp;nbsp;the table orders (via sort descending)&amp;nbsp;&lt;/STRONG&gt;, the "last" - (now: first) value will stay.&lt;/P&gt;&lt;P&gt;So, less open tables - but a weird feeling if what I promise&amp;nbsp;is really true :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt= new table("test", add rows(8),New Column( "Column 1",
set values([1 1 1 1 1 2 2 2])
)
);

dt &amp;lt;&amp;lt;  New Column( "Rank1",	set each value( Col Rank( 1,:Column 1 ) ));


dt2 = dt &amp;lt;&amp;lt; Subset( All rows, Selected columns only( 0 ) );
dt2: Rank1 &amp;lt;&amp;lt; set name("Rank2");

dt &amp;lt;&amp;lt; Sort(By( :Rank1 ),Replace Table,Order( Descending, Descending ));
dt2 &amp;lt;&amp;lt; Sort(By( :Rank2 ),Replace Table,Order( Descending, Descending ));

dt &amp;lt;&amp;lt; Join(
	With( dt2 ),
	Merge Same Name Columns,
	Match Flag( 0 ),
	By Matching Columns( :Column 1 = :Column 1 ),
	Drop multiples( 1, 1 ),
	Include Nonmatches( 0, 0 ),
	Preserve main table order( 0 )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 18:17:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696887#M88207</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-11-10T18:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Many to one Table Join</title>
      <link>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696892#M88208</link>
      <description>&lt;P&gt;Here are some visuals to support&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;suggestions&lt;/P&gt;
&lt;P&gt;Issue 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables=&amp;gt;Join&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Joining Table 2 to Table 1&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1699640145304.png" style="width: 697px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58557iC7F48AAD1BDAD491/image-dimensions/697x406?v=v2" width="697" height="406" role="button" title="txnelson_0-1699640145304.png" alt="txnelson_0-1699640145304.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Issue 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables=&amp;gt;Sort&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Create a Virtual Column and call it Row.......the formula for the column is Row()&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1699640427942.png" style="width: 745px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58559i08FADB2D925F9751/image-dimensions/745x380?v=v2" width="745" height="380" role="button" title="txnelson_1-1699640427942.png" alt="txnelson_1-1699640427942.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Tables=&amp;gt;Join&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;Join Table 1 to Table 2&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_2-1699640752600.png" style="width: 793px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58560iB60DAEFCB5D8FFB4/image-dimensions/793x470?v=v2" width="793" height="470" role="button" title="txnelson_2-1699640752600.png" alt="txnelson_2-1699640752600.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here is the JSL that will run the 2 issues&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt1 = New Table( "Table 1",
	Add Rows( 6 ),
	New Column( "Parameter Set Name",
		Character,
		Set Values(
			{"27109N5", "27109N5", "27109N5", "27109N5", "27109N5", "27109N5"}
		)
	),
	New Column( "Timestamp",
		Format( "yyyy-mm-dd", 12 ),
		Input Format( "yyyy-mm-dd" ),
		Set Values(
			[3600115200, 3600115200, 3600201600, 3600201600, 3600201600, 3600201600]
		)
	),
	New Column( "Parameter X",
		Set Values( [2.32, 1.21, 1.45, 1.45, 7.89, 2.04] )
	)
);

dt2 = New Table( "Table 2",
	Add Rows( 2 ),
	New Column( "Parameter Set Name",
		Character,
		Set Values( {"27109N5", "27109N5"} )
	),
	New Column( "Timestamp",
		Format( "yyyy-mm-dd", 12 ),
		Input Format( "yyyy-mm-dd" ),
		Set Values( [3600115200, 3600201600] )
	),
	New Column( "Parameter Y",
		Format( "Best", 12 ),
		Set Values( [21, 22] )
	)
);

// Join data tables
// → Data Table( "One to Many" )
Data Table( "Table 1" ) &amp;lt;&amp;lt; Join(
	With( Data Table( "Table 2" ) ),
	Merge Same Name Columns,
	By Matching Columns(
		:Parameter Set Name = :Parameter Set Name, :Timestamp = :Timestamp
	),
	Drop multiples( 0, 0 ),
	Include Nonmatches( 0, 0 ),
	Preserve main table order( 1 ),
	Output Table( "One to Many" )
);

// Create the Many to One table
// Sort data table
Data Table( "Table 1" ) &amp;lt;&amp;lt; Sort(
	By(
		:Parameter Set Name,
		:Timestamp,
		Transform Column( "Row", Formula( Row() ) )
	),
	Replace Table,
	Order( Ascending, Ascending, Descending )
);

// Join Table 1 to Table 2
// Join data tables
// → Data Table( "Many to One" )
Data Table( "Table 2" ) &amp;lt;&amp;lt; Join(
	With( Data Table( "Table 1" ) ),
	Merge Same Name Columns,
	By Matching Columns(
		:Parameter Set Name = :Parameter Set Name, :Timestamp = :Timestamp
	),
	Drop multiples( 1, 1 ),
	Include Nonmatches( 0, 0 ),
	Preserve main table order( 1 ),
	Output Table( "Many to One" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 18:47:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696892#M88208</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-11-10T18:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Many to one Table Join</title>
      <link>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696896#M88209</link>
      <description>&lt;P&gt;Thanks for the reply.&amp;nbsp; Im a little fuzzy on creating a virtual column.&amp;nbsp; Could you elaborate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;</description>
      <pubDate>Fri, 10 Nov 2023 18:33:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696896#M88209</guid>
      <dc:creator>timothy_forsyth</dc:creator>
      <dc:date>2023-11-10T18:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Many to one Table Join</title>
      <link>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696900#M88210</link>
      <description>&lt;P&gt;create virtual column ~ transform column:&lt;BR /&gt;&lt;BR /&gt;right click on one of the columns in the list and select row/row:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1699641593990.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58563i321AC98470009771/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1699641593990.png" alt="hogi_1-1699641593990.png" /&gt;&lt;/span&gt;&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>Fri, 10 Nov 2023 18:40:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Many-to-one-Table-Join/m-p/696900#M88210</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-11-10T18:40:04Z</dc:date>
    </item>
  </channel>
</rss>

