<?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: calculation using data from 2 tables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/calculation-using-data-from-2-tables/m-p/453813#M70056</link>
    <description>&lt;P&gt;It seems you don't have a column name "d" for the Formula to work.&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;src &amp;lt;&amp;lt; new column( a, Numeric, continuous, Formula( (b - :Name( d ) ) / (nsigma*c)));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If that does not work you can try to create the line of code as text and parse it for each loop interaction.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jan 2022 21:56:23 GMT</pubDate>
    <dc:creator>ac7872</dc:creator>
    <dc:date>2022-01-24T21:56:23Z</dc:date>
    <item>
      <title>calculation using data from 2 tables</title>
      <link>https://community.jmp.com/t5/Discussions/calculation-using-data-from-2-tables/m-p/453315#M70026</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;wandering if you can help...&lt;/P&gt;&lt;P&gt;I'm trying to create new columns in a table from a calculation of a transposed summary but I keep getting errors&lt;/P&gt;&lt;P&gt;with defining some constants from the table.&lt;/P&gt;&lt;P&gt;any idea what I'm doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;src_tran = src_sum &amp;lt;&amp;lt; Transpose(
		Label( :Label )
	);
Current Data Table( src_tran );	

src_tran &amp;lt;&amp;lt; new column("N", Formula(If( Substr( :Label, 0, 1 ) == "M",
	Substr( Substr( :Label, 6 ), 0, Length( :Label ) - 6 ),
	Substr( Substr( :Label, 9 ), 0, Length( :Label ) - 9 )
)));

g = (Col Number( :Label) -2 );	
for( i = 3, i = g, i++,

a = Char(N[i]) || "_Cv";
d =  Char(N[i]);
b = as column(Row 1)[i];
c = as column(Row 1)[i+1969];


Current Data Table( src );	
src &amp;lt;&amp;lt; new column( a, Numeric, continuous, &lt;BR /&gt;Formula( (b - :d) / (nsigma*c)));

 );	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Log shows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-jsl"&gt;Column SEBV-D_CLK_A Cluster Size RsltF32_Pln00 (365) -1::21205_Cv Formula Interrupted Name Unresolved: d at row 1 in access or evaluation of 'd' , :d/*###*/ Formula evaluation errors have been ignored Name Unresolved: N in access or evaluation of 'N' , :N/*###*/&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:43:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/calculation-using-data-from-2-tables/m-p/453315#M70026</guid>
      <dc:creator>Boaz</dc:creator>
      <dc:date>2023-06-10T23:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: calculation using data from 2 tables</title>
      <link>https://community.jmp.com/t5/Discussions/calculation-using-data-from-2-tables/m-p/453324#M70027</link>
      <description>&lt;P&gt;It appears that you have several scoping and syntax issues, however, it is difficult to precisely guide you without seeing what the data table you are transforming contains.&amp;nbsp; Could you please attach a sample of what that table looks like?&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 11:08:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/calculation-using-data-from-2-tables/m-p/453324#M70027</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-01-23T11:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: calculation using data from 2 tables</title>
      <link>https://community.jmp.com/t5/Discussions/calculation-using-data-from-2-tables/m-p/453813#M70056</link>
      <description>&lt;P&gt;It seems you don't have a column name "d" for the Formula to work.&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;src &amp;lt;&amp;lt; new column( a, Numeric, continuous, Formula( (b - :Name( d ) ) / (nsigma*c)));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If that does not work you can try to create the line of code as text and parse it for each loop interaction.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 21:56:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/calculation-using-data-from-2-tables/m-p/453813#M70056</guid>
      <dc:creator>ac7872</dc:creator>
      <dc:date>2022-01-24T21:56:23Z</dc:date>
    </item>
  </channel>
</rss>

