<?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 Invalid row number when accessing or evaluating of column values in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Invalid-row-number-when-accessing-or-evaluating-of-column-values/m-p/419671#M66864</link>
    <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;after creating a new column &lt;STRONG&gt;Norm_Value&lt;/STRONG&gt; I want apply formula to calculate relative values based on the position of "1" in the &lt;STRONG&gt;Base_value_norm&lt;/STRONG&gt; column:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		dt &amp;lt;&amp;lt; New Column( "Norm_Value",
			Numeric,
			"Continuous",
			formula(
				Eval(
					Eval Expr(
						dt:Value[(:SerialNumber &amp;lt;&amp;lt; get data table) &amp;lt;&amp;lt; get rows where(
							dt:Base_value_norm == 1 &amp;amp; dt:SerialNumber == Expr( dt:SerialNumber[Row()] )
						)] / dt:Value
					)
				)
			)
		);	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The problem is when I try to execute script I get the following error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Invalid row number when accessing or evaluating "dt::SerialNumber[ /*###*/Row()]" , dt :: SerialNumber[/*###*/Row()].&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But If I provide the formula manually after column is created it works as desired. What can be the reason why it is not working in script? I need to do that in script since several new columns need to be created in such a way. The data table with saved formula is attached.&lt;/P&gt;&lt;P&gt;Thank you and best regards&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:37:13 GMT</pubDate>
    <dc:creator>lukasz</dc:creator>
    <dc:date>2023-06-10T23:37:13Z</dc:date>
    <item>
      <title>Invalid row number when accessing or evaluating of column values</title>
      <link>https://community.jmp.com/t5/Discussions/Invalid-row-number-when-accessing-or-evaluating-of-column-values/m-p/419671#M66864</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;after creating a new column &lt;STRONG&gt;Norm_Value&lt;/STRONG&gt; I want apply formula to calculate relative values based on the position of "1" in the &lt;STRONG&gt;Base_value_norm&lt;/STRONG&gt; column:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		dt &amp;lt;&amp;lt; New Column( "Norm_Value",
			Numeric,
			"Continuous",
			formula(
				Eval(
					Eval Expr(
						dt:Value[(:SerialNumber &amp;lt;&amp;lt; get data table) &amp;lt;&amp;lt; get rows where(
							dt:Base_value_norm == 1 &amp;amp; dt:SerialNumber == Expr( dt:SerialNumber[Row()] )
						)] / dt:Value
					)
				)
			)
		);	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The problem is when I try to execute script I get the following error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Invalid row number when accessing or evaluating "dt::SerialNumber[ /*###*/Row()]" , dt :: SerialNumber[/*###*/Row()].&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But If I provide the formula manually after column is created it works as desired. What can be the reason why it is not working in script? I need to do that in script since several new columns need to be created in such a way. The data table with saved formula is attached.&lt;/P&gt;&lt;P&gt;Thank you and best regards&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:37:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Invalid-row-number-when-accessing-or-evaluating-of-column-values/m-p/419671#M66864</guid>
      <dc:creator>lukasz</dc:creator>
      <dc:date>2023-06-10T23:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid row number when accessing or evaluating of column values</title>
      <link>https://community.jmp.com/t5/Discussions/Invalid-row-number-when-accessing-or-evaluating-of-column-values/m-p/419682#M66865</link>
      <description>&lt;P&gt;Am I missing something, or can you simplify the formula to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = :SerialNumber &amp;lt;&amp;lt; get data table;
curSerialNumber = dt:SerialNumber;
dt:Value[dt &amp;lt;&amp;lt; get rows where( dt:Base_value_norm == 1 &amp;amp; dt:SerialNumber == curSerialNumber )] / dt:Value;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Sep 2021 16:20:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Invalid-row-number-when-accessing-or-evaluating-of-column-values/m-p/419682#M66865</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-21T16:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid row number when accessing or evaluating of column values</title>
      <link>https://community.jmp.com/t5/Discussions/Invalid-row-number-when-accessing-or-evaluating-of-column-values/m-p/419952#M66883</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;thank you for suggestion, works as desired.&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 07:31:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Invalid-row-number-when-accessing-or-evaluating-of-column-values/m-p/419952#M66883</guid>
      <dc:creator>lukasz</dc:creator>
      <dc:date>2021-09-22T07:31:44Z</dc:date>
    </item>
  </channel>
</rss>

