<?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: Link Between two tables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Link-Between-two-tables/m-p/12513#M11905</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use Subscribe() to run a script when rows are added to the main table.&amp;nbsp; The following simple example will add the same number of rows to the second smaller table when rows are added to the main Big Class table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;BR /&gt;&lt;P&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;dt2 = New Table( "test" );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;addRowsFn = Function( {a, b, insert},&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; dtname = (a &amp;lt;&amp;lt; Get Name());&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; Print( dtname );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; Print( b );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; Print( insert );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; dt2 &amp;lt;&amp;lt; Add Rows(b);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;dt &amp;lt;&amp;lt; subscribe( "Test Add", onAddRows( addRowsFn, 3 ) );&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More information about subscribing to data tables and other types of subscriptions can be found in the &lt;A href="http://www.jmp.com/support/help/Advanced_Data_Table_Scripting.shtml"&gt;Advanced Data Table Scripting&lt;/A&gt; section of the online documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2015 15:58:43 GMT</pubDate>
    <dc:creator>Wendy_Murphrey</dc:creator>
    <dc:date>2015-05-28T15:58:43Z</dc:date>
    <item>
      <title>Link Between two tables</title>
      <link>https://community.jmp.com/t5/Discussions/Link-Between-two-tables/m-p/12511#M11903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have one data table, and I want to create another data table, but with link between them. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want that second table update, when I insert data (more rows) in the first table.&lt;/P&gt;&lt;P&gt;what I want to do is have fixed columns and when I include new rows in first table, this rows need to be included in the second table (linked table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used Subset to do this, but when I saved and closed the table, the link was lost. Do you know if exist other way to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All those tables will be included in a Journal. I also tried, after that I created the subset table, I used the command in journal “Add Windows Reference”, and the JMP showed me the warning: "Unable to make script for TABLE'S NAME"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2015 17:25:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Link-Between-two-tables/m-p/12511#M11903</guid>
      <dc:creator>shiguelita</dc:creator>
      <dc:date>2015-05-27T17:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Link Between two tables</title>
      <link>https://community.jmp.com/t5/Discussions/Link-Between-two-tables/m-p/12512#M11904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could create a script to update your first table and re-create the second one again, and send to the journal. It would be like an update.&lt;/P&gt;&lt;P&gt;It wouldn't link the second table to the first, though, just make a new, updated version of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attached a table ("The table that gets updated") with a script to do this as an example. Just:&lt;/P&gt;&lt;P&gt;- create a new table&lt;/P&gt;&lt;P&gt;- add some text in a few rows of column1 for that new table (your new rows. I assumed the new rows would come from a separate table)&lt;/P&gt;&lt;P&gt;- call the new table "the update"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then run the script "Update table, take subset and create journal" in "The table that gets updated".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will update the first table with the new rows, creating a brand new table, then take a subset of the brand new table. Each step gets sent to the journal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should be easy to adapt the general idea of the script to your specific needs (just edit the script to see what it does).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 14:15:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Link-Between-two-tables/m-p/12512#M11904</guid>
      <dc:creator>jvillaumie</dc:creator>
      <dc:date>2015-05-28T14:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Link Between two tables</title>
      <link>https://community.jmp.com/t5/Discussions/Link-Between-two-tables/m-p/12513#M11905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use Subscribe() to run a script when rows are added to the main table.&amp;nbsp; The following simple example will add the same number of rows to the second smaller table when rows are added to the main Big Class table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;BR /&gt;&lt;P&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;dt2 = New Table( "test" );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;addRowsFn = Function( {a, b, insert},&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; dtname = (a &amp;lt;&amp;lt; Get Name());&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; Print( dtname );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; Print( b );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; Print( insert );&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp; dt2 &amp;lt;&amp;lt; Add Rows(b);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;dt &amp;lt;&amp;lt; subscribe( "Test Add", onAddRows( addRowsFn, 3 ) );&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More information about subscribing to data tables and other types of subscriptions can be found in the &lt;A href="http://www.jmp.com/support/help/Advanced_Data_Table_Scripting.shtml"&gt;Advanced Data Table Scripting&lt;/A&gt; section of the online documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wendy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2015 15:58:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Link-Between-two-tables/m-p/12513#M11905</guid>
      <dc:creator>Wendy_Murphrey</dc:creator>
      <dc:date>2015-05-28T15:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Link Between two tables</title>
      <link>https://community.jmp.com/t5/Discussions/Link-Between-two-tables/m-p/12514#M11906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wendy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help, sorry for late too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to do this script, but when I save the&amp;nbsp; new table ("test") and close, when I open it again, and I update the main table, the second dont update anymore.&lt;/P&gt;&lt;P&gt;I'm new in JMP, but i'm studing scripts now, so i will try this method with another things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 14:06:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Link-Between-two-tables/m-p/12514#M11906</guid>
      <dc:creator>shiguelita</dc:creator>
      <dc:date>2015-06-18T14:06:53Z</dc:date>
    </item>
  </channel>
</rss>

