<?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: Using Update() to add new rows into main table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/652363#M84236</link>
    <description>&lt;P&gt;I wrote a wish to add an option to update the main table:&lt;/P&gt;&lt;P&gt;&lt;LI-MESSAGE title="Tables join: option to update main table" uid="652242" url="https://community.jmp.com/t5/JMP-Wish-List/Tables-join-option-to-update-main-table/m-p/652242#U652242" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;feel free to support it :)&lt;/img&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2023 07:17:49 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-06-27T07:17:49Z</dc:date>
    <item>
      <title>Using Update() to add new rows into main table</title>
      <link>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390917#M64097</link>
      <description>&lt;P&gt;I am trying to update a table that sometimes contains new rows (based on an index).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that I need to use join, as the following does not seem to work (here, the index is name column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = New Table( "Little Class",
	Add Rows( 3 ),
	New Column( "name",
		Character,
		Nominal,
		Set Values( {"ALICE", "NEW_NAME", "OTHER_NEW_NAME"} )
	),
	New Column( "height",
		Continuous,
		Set Values( [999, 999, 999] )
	),
	New Column( "weight",
		Continuous,
		Set Values( [999, 999, 999] )
	),
	New Column( "RANK",
		Continuous,
		Set Values( [3, 1, 2] )
	),
	New Column( "CODE",
		Continuous,
		Set Values( [0, 1, 1] )
	)
);
dt1 &amp;lt;&amp;lt; Update(
	With( Data Table( "Little Class" ) ),
	Match Columns( :name = :name ),
	Add columns from Update table( {:RANK} )
);
		&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:48:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390917#M64097</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2023-06-09T19:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using Update() to add new rows into main table</title>
      <link>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390952#M64103</link>
      <description>&lt;P&gt;Your stated assumption is correct, you will have to use the Join platform to do what you want.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 12:16:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390952#M64103</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-06-05T12:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using Update() to add new rows into main table</title>
      <link>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390961#M64105</link>
      <description>&lt;P&gt;Found similar post from community here and it was suggested to use Join instead of update when new rows are added:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Updating-JMP-Data-Tables/td-p/16423" target="_self"&gt;Updating JMP Data Tables&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a reason why you couldn't use join instead of update (except that you will have to deal with extra tables)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From JMP Help: &lt;A href="https://www.jmp.com/support/help/en/16.0/index.shtml#page/jmp/update-data-tables.shtml" target="_self"&gt;Update Data Tables&lt;/A&gt; :&lt;/P&gt;&lt;P class="body"&gt;&lt;EM&gt;If you have two data tables and would like to update your original table with data from a new table, select &lt;SPAN class="command"&gt;Tables &amp;gt; Update&lt;/SPAN&gt;. &lt;STRONG&gt;The Update command is a special case of Join in place. It is a Join with the Update option checked&lt;/STRONG&gt;, and it does not result in a new table.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 12:24:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390961#M64105</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-06-05T12:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using Update() to add new rows into main table</title>
      <link>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390981#M64108</link>
      <description>&lt;P&gt;"Except that you will have to deal with extra tables"&lt;BR /&gt;&lt;BR /&gt;Exactly. A new table is generated despite I am doing the join with the update option selected.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt&amp;lt;&amp;lt; Join(
    With( dt_new ),
    Update, // this option is selected
    By Matching Columns( :index= :index),
    Drop multiples( 0, 0 ),
    Include Nonmatches( 1, 1 ),
    Preserve main table order( 1 )&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;//&amp;nbsp;Opens&amp;nbsp;new&amp;nbsp;table&amp;nbsp;apart of dt and&amp;nbsp;dt_new&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 05 Jun 2021 15:48:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390981#M64108</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2021-06-05T15:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using Update() to add new rows into main table</title>
      <link>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390988#M64109</link>
      <description>&lt;P&gt;I tested the same option and it behaved same way, it did create new table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can share the pain with dealing of open tables in JMP, but while scripting it is fairly easy (will add some extra code thou), open/create them as invisible/private and close them immediately without saving after you know you won't be needing them anymore.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Jun 2021 15:54:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390988#M64109</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-06-05T15:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using Update() to add new rows into main table</title>
      <link>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390998#M64112</link>
      <description>I see. What would you recommend to keep this last step simple?&lt;BR /&gt;&lt;BR /&gt;I have 'dt' (original) and the 'dt_joined' ('dt' + 'dt_new').&lt;BR /&gt;</description>
      <pubDate>Sat, 05 Jun 2021 16:43:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/390998#M64112</guid>
      <dc:creator>FN</dc:creator>
      <dc:date>2021-06-05T16:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using Update() to add new rows into main table</title>
      <link>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/391001#M64113</link>
      <description>&lt;P&gt;Most of the time I would do it with Invisible tables, because that gives possibility to open them easily from JMPs window list (if they haven't been closed).&lt;/P&gt;&lt;P&gt;Invisible tables are in grey color (transparent) in the Window List and you make them visible by double clicking on them.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1622911801553.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33295i15FE7B879B4444CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1622911801553.png" alt="jthi_1-1622911801553.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I also suggest adding names to tables, as it makes it easier to start debugging when you have lots of tables open and for some reason the code didn't execute properly. Without renaming they will be just became a mess like: Subset of something 1, Subset of something 2, Untitled 1 and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is an example which will open dt as invisible and create dt_new as invisible table. Then join them to new table called JOINED_TABLE which will be shown to the user and finally close dt and dt_new without saving them. &lt;CODE class=" language-jsl"&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp", invisible);
dt_new = New Table( "Little Class",
	Add Rows( 3 ),
	New Column( "name",
		Character,
		Nominal,
		Set Values( {"ALICE", "NEW_NAME", "OTHER_NEW_NAME"} )
	),
	New Column( "height",
		Continuous,
		Set Values( [999, 999, 999] )
	),
	New Column( "weight",
		Continuous,
		Set Values( [999, 999, 999] )
	),
	New Column( "RANK",
		Continuous,
		Set Values( [3, 1, 2] )
	),
	New Column( "CODE",
		Continuous,
		Set Values( [0, 1, 1] )
	),
	invisible
);

dt_joined = dt &amp;lt;&amp;lt; Join(
	With(dt_new),
	Merge Same Name Columns,
	By Matching Columns(:name = :name),
	Drop multiples(0, 0),
	Include Nonmatches(1, 1),
	Preserve main table order(1),
	Output table("JOINED_TABLE")
);
Close(dt, no save);
Close(dt_new, no save);&lt;/CODE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 05 Jun 2021 16:57:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/391001#M64113</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-06-05T16:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using Update() to add new rows into main table</title>
      <link>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/652363#M84236</link>
      <description>&lt;P&gt;I wrote a wish to add an option to update the main table:&lt;/P&gt;&lt;P&gt;&lt;LI-MESSAGE title="Tables join: option to update main table" uid="652242" url="https://community.jmp.com/t5/JMP-Wish-List/Tables-join-option-to-update-main-table/m-p/652242#U652242" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;feel free to support it :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 07:17:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/652363#M84236</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-06-27T07:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using Update() to add new rows into main table</title>
      <link>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/653859#M84321</link>
      <description>&lt;P&gt;The new Join Platform could look like this:&lt;BR /&gt;&lt;A href="https://community.jmp.com/t5/JMP-Wish-List/Tables-join-option-to-update-main-table/idc-p/653857/highlight/true#M4537" target="_blank"&gt;https://community.jmp.com/t5/JMP-Wish-List/Tables-join-option-to-update-main-table/idc-p/653857/highlight/true#M4537&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1687982851331.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/54244i6578BB01267DEA92/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1687982851331.png" alt="hogi_0-1687982851331.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 20:08:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Using-Update-to-add-new-rows-into-main-table/m-p/653859#M84321</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-06-28T20:08:46Z</dc:date>
    </item>
  </channel>
</rss>

