<?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: How to calculate the difference between two identical tables ? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876350#M103958</link>
    <description>&lt;P&gt;I'm not sure what the identical means here (in identical tables the difference would be 0?). Do you have same column names? Where should the result be stored? What is "each case", difference of columns?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 May 2025 08:37:11 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-05-26T08:37:11Z</dc:date>
    <item>
      <title>How to calculate the difference between two identical tables ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876328#M103955</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have two identical tables of test results from two different times.&lt;/P&gt;
&lt;P&gt;Is there a simple function that can calculate the difference for each case?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 07:51:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876328#M103955</guid>
      <dc:creator>SamplingHamster</dc:creator>
      <dc:date>2025-05-26T07:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two identical tables ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876350#M103958</link>
      <description>&lt;P&gt;I'm not sure what the identical means here (in identical tables the difference would be 0?). Do you have same column names? Where should the result be stored? What is "each case", difference of columns?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 08:37:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876350#M103958</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-05-26T08:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two identical tables ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876352#M103959</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thanks for you reply.&lt;/P&gt;
&lt;P&gt;Labels of Colums and Rows are the same. Values are differents. I want to calculate the drift of each cell (sorry not each case).&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 09:05:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876352#M103959</guid>
      <dc:creator>SamplingHamster</dc:creator>
      <dc:date>2025-05-26T09:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two identical tables ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876376#M103960</link>
      <description>&lt;P&gt;Not sure where the results should be calculated, so I will demonstrate fairly simple process which will create new table with the result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Join tables together using By Row Number&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1748252060834.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76225iC02D8C222981A7AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1748252060834.png" alt="jthi_0-1748252060834.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Pick columns in pairs and create the formulas&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1748252154731.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76226iA7E16137968E12E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1748252154731.png" alt="jthi_1-1748252154731.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And you should end up with the result columns as formulas&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_2-1748252197648.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76227iFCAE5DD957A937D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_2-1748252197648.png" alt="jthi_2-1748252197648.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 09:38:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876376#M103960</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-05-26T09:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two identical tables ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876379#M103961</link>
      <description>If the table is all numeric, you could use data table subscripting to make a pair of matrices and subtract them, then write them back to a new table. &lt;BR /&gt;With a little more work, you could do the same thing by choosing just the numeric columns.</description>
      <pubDate>Mon, 26 May 2025 11:56:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876379#M103961</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-05-26T11:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two identical tables ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876389#M103964</link>
      <description>&lt;P&gt;And this would be the idea using data table subscripting and creating a new table&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Big Class Families.jmp");
dt2 &amp;lt;&amp;lt; Sort(By(:sports),Replace Table,Order(Ascending),Copy formula(0)); // demo purposes

If(N Rows(dt) != N Rows(dt),
	Throw("Rows do not match");
);

cont_cols1 = dt &amp;lt;&amp;lt; Get Column Names(Continuous, "String");
cont_cols2 = dt2 &amp;lt;&amp;lt; Get Column Names(Continuous, "String");

If(cont_cols1 != cont_cols2,
	Throw("Columns do not match");
);

res = dt[0, cont_cols1] - dt2[0, cont_cols2];

dt_res = As Table(res);
For Each({colname, idx}, cont_cols1,
	Column(dt_res, idx) &amp;lt;&amp;lt; Set Name(colname);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 May 2025 12:36:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876389#M103964</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-05-26T12:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two identical tables ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876390#M103965</link>
      <description>&lt;P&gt;Here is a simple script that will take 2 identical all numeric tables....identical in column names and number of rows, and create a new table that is the difference between the 2 tables&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt1 = data table("name of first table");
dt2 = data table("name of second table");
// Create a new table from one of the 2 tables
dt3 = dt1 &amp;lt;&amp;lt; subset( selected rows(0), selected columns(0));
// Replace cell values in the third data table with the 
// differences between table 1 and table 2
dt3[0,0] = dt1[0,0]-dt2[0,0];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 12:43:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876390#M103965</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-05-26T12:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the difference between two identical tables ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876529#M103969</link>
      <description>&lt;P&gt;Thank you for your help. It works.&lt;/P&gt;</description>
      <pubDate>Tue, 27 May 2025 11:26:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-calculate-the-difference-between-two-identical-tables/m-p/876529#M103969</guid>
      <dc:creator>SamplingHamster</dc:creator>
      <dc:date>2025-05-27T11:26:58Z</dc:date>
    </item>
  </channel>
</rss>

