<?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 Script to create a new data table by subtracting one data table from another. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-to-create-a-new-data-table-by-subtracting-one-data-table/m-p/725282#M90944</link>
    <description>&lt;P&gt;I have two data tables in my project and am trying to write a script that would like to create a third data table which is the values in table #2 subtracted from table #1. Categorical variable columns and column names are the same in both tables and would need to be the same in table #3. I'm using JMP pro 16.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Feb 2024 16:00:08 GMT</pubDate>
    <dc:creator>Mcc99</dc:creator>
    <dc:date>2024-02-23T16:00:08Z</dc:date>
    <item>
      <title>Script to create a new data table by subtracting one data table from another.</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-create-a-new-data-table-by-subtracting-one-data-table/m-p/725282#M90944</link>
      <description>&lt;P&gt;I have two data tables in my project and am trying to write a script that would like to create a third data table which is the values in table #2 subtracted from table #1. Categorical variable columns and column names are the same in both tables and would need to be the same in table #3. I'm using JMP pro 16.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 16:00:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-create-a-new-data-table-by-subtracting-one-data-table/m-p/725282#M90944</guid>
      <dc:creator>Mcc99</dc:creator>
      <dc:date>2024-02-23T16:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create a new data table by subtracting one data table from another.</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-create-a-new-data-table-by-subtracting-one-data-table/m-p/725286#M90947</link>
      <description>&lt;P&gt;I don't really use projects, but this can give you one idea for the script using &lt;LI-MESSAGE title="Data table subscripting" uid="21013" url="https://community.jmp.com/t5/Uncharted/Data-table-subscripting/m-p/21013#U21013" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;(it assumes both have same amount of rows and columns)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled 2",
	Add Rows(3),
	Compress File When Saved(1),
	New Column("Column 1", Character, "Nominal", Set Values({"A", "B", "C"})),
	New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3])),
	New Column("Column 3", Numeric, "Continuous", Format("Best", 12), Set Values([4, 6, 8]))
);

dt2 = New Table("Untitled 2",
	Add Rows(3),
	Compress File When Saved(1),
	New Column("Column 1", Character, "Nominal", Set Values({"A", "B", "C"})),
	New Column("Column 2", Numeric, "Continuous", Format("Best", 12), Set Values([2, 3, 4])),
	New Column("Column 3", Numeric, "Continuous", Format("Best", 12), Set Values([8, 12, 18]))
);

dt3 = dt2 &amp;lt;&amp;lt; Subset(All Rows, Seleted Columns(0));

cont_cols = dt2 &amp;lt;&amp;lt; Get Column Names(Continuous, "String");

dt3[0, cont_cols] = dt3[0, cont_cols] - dt[0, cont_cols];&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2024 16:07:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-create-a-new-data-table-by-subtracting-one-data-table/m-p/725286#M90947</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-02-23T16:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script to create a new data table by subtracting one data table from another.</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-create-a-new-data-table-by-subtracting-one-data-table/m-p/725591#M91017</link>
      <description>&lt;P&gt;Thanks! This worked well!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 14:06:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-create-a-new-data-table-by-subtracting-one-data-table/m-p/725591#M91017</guid>
      <dc:creator>Mcc99</dc:creator>
      <dc:date>2024-02-27T14:06:09Z</dc:date>
    </item>
  </channel>
</rss>

