<?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: Add/Subtract values from two jmp files in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/518159#M74437</link>
    <description>&lt;P&gt;Your code is confusing to me.&amp;nbsp; When you have&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;For Each Row&lt;/P&gt;
&lt;P&gt;each separate row within the data table is processed.&lt;/P&gt;
&lt;P&gt;When the Get Row Where() is used, it is only passing through the data once.&amp;nbsp; Can you provide a sample of the results you are expecting?&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2022 18:26:50 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2022-07-06T18:26:50Z</dc:date>
    <item>
      <title>Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510587#M73815</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I need help to offset the data set using the reference value in JSL&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;First table contains reference value&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jacksmith12_0-1655397972661.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43323iED598A400831E259/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jacksmith12_0-1655397972661.png" alt="Jacksmith12_0-1655397972661.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;Second table contains strips tested measurements&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jacksmith12_1-1655398026429.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43324i226D8DD4CFBDAB27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jacksmith12_1-1655398026429.png" alt="Jacksmith12_1-1655398026429.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to subtract mean of strip A from the reference data table and then add to to the data set&amp;nbsp;&lt;BR /&gt;for example :&lt;/P&gt;&lt;P&gt;step1. the mean value for strips A for current = (10+3)/2 = 6.5. So, 400 - 6.5 = 393.5 and likewise for other strips&lt;/P&gt;&lt;P&gt;step2. Add 393.5 to the 2nd data table of strip A &amp;gt;&amp;gt; 393.2 + 10 = 403.2 and likewise for other strips&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final table should have following values:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jacksmith12_2-1655398395594.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43325i5FE0B67036F782D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jacksmith12_2-1655398395594.png" alt="Jacksmith12_2-1655398395594.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Refer attached file for details.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for your help!&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This what I tried:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current data table();
dtOffset = Open(Limits);

colList = dt &amp;lt;&amp;lt; get column names(string);

For( i = 1, i &amp;lt;= N Items( colList ), i++, 
	
	theRow = dtOffset &amp;lt;&amp;lt; get rows where( dtOffset:Tests == colList[i] );
	show(i,nrows(therow));
	
	If( N Rows( theRow ) == 1,
		offset = dtOffset:Offset[theRow[1]];
		For( k = 1, k &amp;lt;= N Rows( dt ), k++,
			Column( dt, i )[k] = Column( dt, i )[k] + offset
		);
	);
	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:01:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510587#M73815</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2023-06-09T17:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510589#M73816</link>
      <description>&lt;P&gt;Please try this example:&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( "Reference data.jmp" );
dt2 = Open( "Data set.jmp" );

For( c = 1, c &amp;lt;= N Col( dt2 ), c++,
	name = Column( dt2, c ) &amp;lt;&amp;lt; Get Name;
	mean = dt1:Mean[dt1 &amp;lt;&amp;lt; Get Rows Where( :Tests == name )];
	measure = mean - (Column dt2, c ) &amp;lt;&amp;lt; Get As Matrix);
	Column( dt2, c) &amp;lt;&amp;lt; Set Values( measure );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Jun 2022 17:12:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510589#M73816</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-06-16T17:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510634#M73829</link>
      <description>&lt;P&gt;Thanks Mark. The code doesn't seem to work&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Jacksmith12_0-1655408957621.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43354i949F36F5D9AA7AAD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jacksmith12_0-1655408957621.png" alt="Jacksmith12_0-1655408957621.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 19:49:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510634#M73829</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2022-06-16T19:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510635#M73830</link>
      <description>&lt;P&gt;Thee was a misplaced "(".&amp;nbsp; Here is a corrected version&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt1 = Open( "Reference data.jmp" );
dt2 = Open( "Data set.jmp" );

For( c = 1, c &amp;lt;= N Col( dt2 ), c++,
	name = Column( dt2, c ) &amp;lt;&amp;lt; Get Name;
	mean = dt1:Mean[dt1 &amp;lt;&amp;lt; Get Rows Where( :Tests == name )];
	measure = mean - Column( dt2, c ) &amp;lt;&amp;lt; Get As Matrix;
	Column( dt2, c ) &amp;lt;&amp;lt; Set Values( measure );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Jun 2022 19:59:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510635#M73830</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-06-16T19:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510637#M73831</link>
      <description>&lt;P&gt;Hey Jim,&lt;/P&gt;&lt;P&gt;Thanks for correcting but it didn't seem to work either.&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="Jacksmith12_0-1655411528690.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43355i4B2E88A63E367248/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jacksmith12_0-1655411528690.png" alt="Jacksmith12_0-1655411528690.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 20:32:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510637#M73831</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2022-06-16T20:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510651#M73834</link>
      <description>&lt;P&gt;I was making changes to Mark's code, based upon syntax issues, not logic issues.&amp;nbsp; I have reworked the code and I believe this will work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt1 = open( "Reference data.jmp" );
dt2 = open( "Data set.jmp" );

For( c = 1, c &amp;lt;= N Col( dt2 ) -1, c++,
	theMatrix = [];
	name = Column( dt2, c ) &amp;lt;&amp;lt; Get Name;
	For( r = 1, r &amp;lt;= N Rows( dt2 ), r++,
		mean = dt1:Mean[dt1 &amp;lt;&amp;lt; Get Rows Where( :Tests == name )];
		measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
		theMatrix = theMatrix || Column( dt2, c )[r] + measure;
	);
	Column( dt2, c ) &amp;lt;&amp;lt; Set Values( theMatrix );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Jun 2022 22:04:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510651#M73834</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-06-16T22:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510684#M73852</link>
      <description>&lt;P&gt;Thanks Jim :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 12:34:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/510684#M73852</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2022-06-17T12:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/517910#M74417</link>
      <description>&lt;P&gt;Hi Jim&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Quick question:&lt;/P&gt;&lt;P&gt;I modified the jsl script and want to filter rows based on the check box selection.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below script will create a new window, ask user to select the check box for site number.&lt;/P&gt;&lt;P&gt;I want to only add mean offset to the SiteNumber selection.&lt;/P&gt;&lt;P&gt;If SiteNumber 1 is selected, align only those rows . I have attached both files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using get rows where but the results doesn't seem to be accurate. Looking for some suggestions&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Clear globals();
Clear log();
dt1 = Data table( "Reference data table" );
dt2 = Current data table(); /// Select Data table.jmp




For(i=1,i&amp;lt;=nrows(dt1),i++,
	theTest = dt1:Tests[i];
	try(column(dt2,theTest) &amp;lt;&amp;lt; set property("TheMean", dt1:Mean[i]));
);

New window( "", modal,
			ct = checkbox({"1","2"}),
			Buttonbox ("Ok",
				ft = ct &amp;lt;&amp;lt; Get Selected Indices();
			), ct &amp;lt;&amp;lt; set all(1);
	
	
);

sitenum = {2};


//Insert Into (sitenum, ft);


Col_List1 = dt2 &amp;lt;&amp;lt; Get Column Names( "String" );

//if (!contains(Col_List1, "SiteNumber"),
     // dt2 &amp;lt;&amp;lt;New Column("SiteNumber", "Numeric", "Continuous", &amp;lt;&amp;lt;Set Each Value( 1 ) );
     
   //   );


For( c = 1, c &amp;lt;= N Col( dt2 ) -1, c++,
	theMatrix = [];
	name = Column( Col_List1[c] ) &amp;lt;&amp;lt; Get name;
	if (Contains( Col_List1[c], "Current 1.1") | Contains( Col_List1[c], "Voltage 1.7"),
	//For( r = 1, r &amp;lt;= N Rows( dt2 ), r++,
	//For Each Row( r=row();
	
        r = dt2 &amp;lt;&amp;lt; get rows where(contains(sitenum, dt2:SiteNumber)); ///** get rows based upon the check box input
		//mean = dt1:Mean[dt1 &amp;lt;&amp;lt; Get Rows Where( :Tests == name )];
		mean = column(dt2, Col_list1[c]) &amp;lt;&amp;lt; get property("theMean");
		//measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
		measure = mean - Col Mean(as Column( dt2, c ),:Wafer ID);
		theMatrix = theMatrix || Column( dt2, c )[r] + measure;
	
	Column( dt2, c ) &amp;lt;&amp;lt; Set Values( theMatrix );
););&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 20:14:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/517910#M74417</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2022-07-05T20:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/517922#M74418</link>
      <description>&lt;P&gt;Doing a quick look at the script, a couple of items pop out.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The reference data table does not contain any Tests names that match the column names in the Data Table&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;The Get Rows Where() will not work.&amp;nbsp; Are you attempting to find all rows that match the sitenum?&amp;nbsp; If so it shoul be
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;r = dt2 &amp;lt;&amp;lt; get rows where(dt2:sitenumber == sitenum[1]);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 05 Jul 2022 20:56:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/517922#M74418</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-05T20:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/517955#M74419</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologize! I attached wrong files. Below are the updated data tables.&lt;/P&gt;&lt;P&gt;I tried but the results aren't accurate&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Clear globals();
Clear log();
dt1 = Data table( "Reference data table" );
dt2 = Current data table(); /// Select Data table.jmp




For(i=1,i&amp;lt;=nrows(dt1),i++,
	theTest = dt1:Tests[i];
	try(column(dt2,theTest) &amp;lt;&amp;lt; set property("TheMean", dt1:Mean[i]));
);

New window( "", modal,
			ct = checkbox({"1","2"}),
			Buttonbox ("Ok",
				ft = ct &amp;lt;&amp;lt; Get Selected Indices();
			), ct &amp;lt;&amp;lt; set all(1);
	
	
);

sitenum = {};


Insert Into (sitenum, ft);


Col_List1 = dt2 &amp;lt;&amp;lt; Get Column Names( "String" );

//if (!contains(Col_List1, "SiteNumber"),
     // dt2 &amp;lt;&amp;lt;New Column("SiteNumber", "Numeric", "Continuous", &amp;lt;&amp;lt;Set Each Value( 1 ) );
     
   //   );



For( c = 1, c &amp;lt;= N Col( dt2 ) -1, c++,
	theMatrix = [];
	name = Column( Col_List1[c] ) &amp;lt;&amp;lt; Get name;
	if (Contains( Col_List1[c], "Current 1.1") | Contains( Col_List1[c], "Voltage 1.7"),
	//For( r = 1, r &amp;lt;= N Rows( dt2 ), r++,
	//For Each Row( r=row();
	r = dt2 &amp;lt;&amp;lt; get rows where(dt2:SiteNumber == sitenum[1]);
		//mean = dt1:Mean[dt1 &amp;lt;&amp;lt; Get Rows Where( :Tests == name )];
		mean = column(dt2, Col_list1[c]) &amp;lt;&amp;lt; get property("theMean");
		//measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
		measure = mean - Col Mean(as Column( dt2, c ),:Wafer ID);
		theMatrix = theMatrix || Column( dt2, c )[r] + measure;
	
	Column( dt2, c ) &amp;lt;&amp;lt; Set Values( theMatrix );
););&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 21:35:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/517955#M74419</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2022-07-05T21:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/517958#M74420</link>
      <description>&lt;P&gt;The calculation of "measure" can not be calculated.&amp;nbsp; You have written a line of JSL that assumes that it is looping through a data table, but no looping through the rows is happening.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 22:13:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/517958#M74420</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-05T22:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/517963#M74421</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used For each rows syntax but the loop takes 40 min to complete. Any alternate way?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( c = 1, c &amp;lt;= N Col( dt2 ) -1, c++,
	theMatrix = [];
	name = Column( Col_List1[c] ) &amp;lt;&amp;lt; Get name;
	if (Contains( Col_List1[c], "Current"),
	//For( r = 1, r &amp;lt;= N Rows( dt2 ), r++,
For Each Row( 
	&lt;BR /&gt; r = dt2 &amp;lt;&amp;lt; get rows where(dt2:sitenumber == sitenum[1]);
		//mean = dt1:Mean[dt1 &amp;lt;&amp;lt; Get Rows Where( :Tests == name )];
		mean = column(dt2, Col_list1[c]) &amp;lt;&amp;lt; get property("theMean");
		//measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
		measure = mean - Col Mean(as Column( dt2, c ),:Wafer ID);
		theMatrix = theMatrix || Column( dt2, c )[r] + measure;
	);
	Column( dt2, c ) &amp;lt;&amp;lt; Set Values( theMatrix );
););&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jul 2022 00:06:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/517963#M74421</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2022-07-06T00:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/518103#M74431</link>
      <description>&lt;P&gt;any advice Jim?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 15:34:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/518103#M74431</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2022-07-06T15:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/518159#M74437</link>
      <description>&lt;P&gt;Your code is confusing to me.&amp;nbsp; When you have&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;For Each Row&lt;/P&gt;
&lt;P&gt;each separate row within the data table is processed.&lt;/P&gt;
&lt;P&gt;When the Get Row Where() is used, it is only passing through the data once.&amp;nbsp; Can you provide a sample of the results you are expecting?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 18:26:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/518159#M74437</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-06T18:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/518309#M74439</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Below is the Screen short of the results that I am expecting. I have attached the final result data table&lt;/P&gt;&lt;P&gt;Here are the steps:&lt;/P&gt;&lt;P&gt;1. Read data table and reference data table&lt;/P&gt;&lt;P&gt;2. Generate a new window to select site number,&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Based on the user input (Site Number 1 or 2), align those data to the reference data table values&lt;/P&gt;&lt;P&gt;&amp;nbsp;Take mean by wafer Id, apply the offset to the main data table&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="Jacksmith12_0-1657137010586.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43775i2DB260E41B5D8B28/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Jacksmith12_0-1657137010586.png" alt="Jacksmith12_0-1657137010586.png" /&gt;&lt;/span&gt;&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 );
Clear globals();
Clear log();
dt1 = Data table( "Reference data table" );
dt2 = Current data table(); /// Select Data table.jmp




For(i=1,i&amp;lt;=nrows(dt1),i++,
	theTest = dt1:Tests[i];
	try(column(dt2,theTest) &amp;lt;&amp;lt; set property("TheMean", dt1:Mean[i]));
);

New window( "", modal,
			ct = checkbox({"1","2"}),
			Buttonbox ("Ok",
				get = ct &amp;lt;&amp;lt; Get Selected ();
			)
	
	
);


sitenum = Transform Each({str}, get, Num(str));	


Col_List1 = dt2 &amp;lt;&amp;lt; Get Column Names( "String" );

//if (!contains(Col_List1, "SiteNumber"),
     // dt2 &amp;lt;&amp;lt;New Column("SiteNumber", "Numeric", "Continuous", &amp;lt;&amp;lt;Set Each Value( 1 ) );
     
   //   );


For( c = 1, c &amp;lt;= N Col( dt2 ) -1, c++,
	theMatrix = [];
	name = Column( Col_List1[c] ) &amp;lt;&amp;lt; Get name;
	if (Contains( Col_List1[c], "Current 1.1") | Contains( Col_List1[c], "Current 2.1") | Contains( Col_List1[c], "Voltage 1.1"),
	For each row(&lt;BR /&gt;         r = dt2 &amp;lt;&amp;lt; get rows where(dt2:sitenumber == sitenum[1]); /// something needs to change here ****&amp;amp;&amp;amp;&amp;amp;**&amp;amp;&amp;amp;&amp;amp;&amp;amp;**&amp;amp;&amp;amp;&amp;amp;

			//mean = dt1:Mean[dt1 &amp;lt;&amp;lt; Get Rows Where( :Tests == name )];
		mean = column(dt2, Col_list1[c]) &amp;lt;&amp;lt; get property("theMean");
		//measure = mean - Col Mean( If( dt2:Strips == dt2:Strips[r], Column( dt2, c ), . ) );
		measure = mean - Col Mean(as Column( dt2, c ),:Wafer ID);
		theMatrix = theMatrix || Column( dt2, c )[r] + measure;
	);
	Column( dt2, c ) &amp;lt;&amp;lt; Set Values( theMatrix );
););&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 19:57:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/518309#M74439</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2022-07-06T19:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Add/Subtract values from two jmp files</title>
      <link>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/518411#M74444</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;can you identify what's going wrong&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 00:16:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-Subtract-values-from-two-jmp-files/m-p/518411#M74444</guid>
      <dc:creator>Jackie_</dc:creator>
      <dc:date>2022-07-07T00:16:36Z</dc:date>
    </item>
  </channel>
</rss>

