<?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 get a formula column by row sub group in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109807#M39709</link>
    <description>&lt;P&gt;try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;n = 5; Col Sum(:Data, Ceiling(Row() / n))&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Feb 2019 07:33:27 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2019-02-11T07:33:27Z</dc:date>
    <item>
      <title>How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109776#M39691</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I d like to create a formula column (sum&amp;nbsp;or mean etc.) with sub groups. The sub groups should be selected by rows, for example all 5 following rows drom a data table or in general all N rows. Any ideas to solve this&amp;nbsp;with row()?&lt;/P&gt;&lt;P&gt;Attache a file to add the formula column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 15:41:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109776#M39691</guid>
      <dc:creator>Thomas1</dc:creator>
      <dc:date>2019-02-10T15:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109777#M39692</link>
      <description>&lt;P&gt;The Col Moving Average() function is what you need to use.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For your averaging the formula would be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Moving Average( :Data, 1, 0, 5 )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To calculate the sum it would be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Moving Average( :Data, 1, 0, 5 ) * 6&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Documentation on the function is found in the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;Scripting Index&lt;/P&gt;
&lt;P&gt;look for Statistical Functions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 15:56:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109777#M39692</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-02-10T15:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109780#M39693</link>
      <description>Hi Jim,&lt;BR /&gt;&lt;BR /&gt;Thanks for your fast response. Actually I'm looking for column formulas for row sub groups (for example row1 1-5, row1 6-10 ..., in general row 1-n, row n+1 - 2n, row 2n+1 - 3n...), where I can apply the column formulas from JMP.</description>
      <pubDate>Sun, 10 Feb 2019 18:24:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109780#M39693</guid>
      <dc:creator>Thomas1</dc:creator>
      <dc:date>2019-02-10T18:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109782#M39695</link>
      <description>That is a bit confusing......could you provide a sample table?</description>
      <pubDate>Sun, 10 Feb 2019 19:28:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109782#M39695</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-02-10T19:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109786#M39697</link>
      <description>&lt;P&gt;Try using a Row() transformation as optional ByGroup argument of the "Col Stat()" functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Parameter({n = 5}, Col Sum(:Data, Ceiling(Row() / n)))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Feb 2019 22:59:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109786#M39697</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-02-10T22:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109788#M39699</link>
      <description>&lt;P class="p1"&gt;Attached a sample file with a new column "Sum_of_each_5_Data_rows". This shows the sum of sub groups build from every 5 rows (N=5) of the data column.&lt;/P&gt;&lt;P class="p1"&gt;How could this be done by using any given row numbers for the subgroup to create column formulas like&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;Col Sum,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;Col Mean, Col Min etc.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 23:10:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109788#M39699</guid>
      <dc:creator>Thomas1</dc:creator>
      <dc:date>2019-02-10T23:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109806#M39708</link>
      <description>&lt;P&gt;Hi ms,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your support. Your formula works great. Despite the formula delviers the approriate reuslts, the formal editor is marking n red in the formul part:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;( Row() / n ) ) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and delievers an error code. The error code is "&lt;SPAN&gt;Error: Name Unresolved: n". Are there any reasons to be concerned?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 07:26:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109806#M39708</guid>
      <dc:creator>Thomas1</dc:creator>
      <dc:date>2019-02-11T07:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109807#M39709</link>
      <description>&lt;P&gt;try&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;n = 5; Col Sum(:Data, Ceiling(Row() / n))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Feb 2019 07:33:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109807#M39709</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-02-11T07:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109809#M39711</link>
      <description>&lt;P&gt;Thanks Jim. Your formual works also. However, similar to the solution from ms I'm getting the error code from the formula editor for n "Error: Name Unresolved: n", despite the formual is working (JMP 14.0)&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 07:53:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109809#M39711</guid>
      <dc:creator>Thomas1</dc:creator>
      <dc:date>2019-02-11T07:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109811#M39713</link>
      <description>&lt;P&gt;Not sure why you see this error message. You could try updating to the latest version to see if it helps. But, you could hard code the value of &lt;EM&gt;n&lt;/EM&gt;&amp;nbsp;to avoid the variable in the formula if the number is constant.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or try with &lt;EM&gt;Local()&lt;/EM&gt; instead of &lt;EM&gt;Parameter()&lt;/EM&gt; (which actually is what I intended in my first post).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Local({n = 5}, Col Sum(:Data, Ceiling(Row() / n)))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Feb 2019 08:34:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109811#M39713</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-02-11T08:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109812#M39714</link>
      <description>&lt;P&gt;Hi ms,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the update. The local approach&amp;nbsp;delivers the results, without error code from the&amp;nbsp;formula editor.&lt;/P&gt;&lt;P&gt;By the way, what is the difference between Parameter() and local()?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 09:10:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109812#M39714</guid>
      <dc:creator>Thomas1</dc:creator>
      <dc:date>2019-02-11T09:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109813#M39715</link>
      <description>&lt;P&gt;As I understand it, &lt;EM&gt;Local()&lt;/EM&gt; simply let variables to be defined and evaluated within the context of the column formula, eliminating risk of interference with global variables with the same name. Parameters are used in optimization problems, i.e. the nonlinear platform.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 09:23:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109813#M39715</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-02-11T09:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a formula column by row sub group</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109820#M39721</link>
      <description>Thanks</description>
      <pubDate>Mon, 11 Feb 2019 12:28:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-a-formula-column-by-row-sub-group/m-p/109820#M39721</guid>
      <dc:creator>Thomas1</dc:creator>
      <dc:date>2019-02-11T12:28:41Z</dc:date>
    </item>
  </channel>
</rss>

