<?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 rows every x rows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270278#M52618</link>
    <description>&lt;P&gt;I am running JMP13 but I don't think that is the cause of the issue.&amp;nbsp; Think I will contact tech support.&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jun 2020 18:13:10 GMT</pubDate>
    <dc:creator>jimloughlin</dc:creator>
    <dc:date>2020-06-02T18:13:10Z</dc:date>
    <item>
      <title>Add rows every x rows</title>
      <link>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270160#M52586</link>
      <description>&lt;P&gt;Dear community, i've got a huge table and would like to add one row every 4 rows (4 rows data, adding 1 row, moving the rest of the data downwards, then adding 1 row after 4 rows of data aso).&lt;/P&gt;&lt;P&gt;I have no clue how to achieve that with a script. Can anyone kindly help me with this topic?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:27:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270160#M52586</guid>
      <dc:creator>Sandra</dc:creator>
      <dc:date>2023-06-09T23:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Add rows every x rows</title>
      <link>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270172#M52588</link>
      <description>&lt;P&gt;See Help &amp;gt; Scripting Index:&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="Capture.JPG" style="width: 862px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24289i87A80038ADC612B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &amp;lt;&amp;lt; Add Rows message to the data table will do what you want. The optional After argument identifies the location, so you can space the insertions every 4 rows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the For() function to iterate over the data table. The iteration will be easiest if you start at the end and insert on the way to the top. The insertions will each length the data table and complicate the counting if you start at the top.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 13:47:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270172#M52588</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-06-02T13:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add rows every x rows</title>
      <link>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270200#M52594</link>
      <description>&lt;P&gt;Just to add to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt; suggestion, here is a real simple example&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");

For(i=N Rows(dt),i&amp;gt;=1,i=i-4,
	dt &amp;lt;&amp;lt; add rows(1, after(i))
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Jun 2020 14:35:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270200#M52594</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-06-02T14:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add rows every x rows</title>
      <link>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270274#M52615</link>
      <description>&lt;P&gt;When I run the code, I get the following error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Name Unresolved: after in access or evaluation of 'after' , after( i ) /*###*/argument is wrong type in access or evaluation of 'after' , after( i ) /*###*/
In the following script, error marked by /*###*/
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
For( i = N Rows( dt ), i &amp;gt;= 1, i = i - 4,
dt &amp;lt;&amp;lt; add rows( 1, after( i ) /*###*/ )
);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 19:21:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270274#M52615</guid>
      <dc:creator>jimloughlin</dc:creator>
      <dc:date>2020-06-02T19:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Add rows every x rows</title>
      <link>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270277#M52617</link>
      <description>&lt;P&gt;It works for me:&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="Capture.JPG" style="width: 781px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/24303iA911B05E8FD53E11/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&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 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
For( i = N Rows( dt ), i &amp;gt;= 1, i = i - 4,
	dt &amp;lt;&amp;lt; Add Rows( 1, After( i ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Jun 2020 18:01:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270277#M52617</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2020-06-02T18:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Add rows every x rows</title>
      <link>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270278#M52618</link>
      <description>&lt;P&gt;I am running JMP13 but I don't think that is the cause of the issue.&amp;nbsp; Think I will contact tech support.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 18:13:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270278#M52618</guid>
      <dc:creator>jimloughlin</dc:creator>
      <dc:date>2020-06-02T18:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Add rows every x rows</title>
      <link>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270279#M52619</link>
      <description>&lt;P&gt;I bet you are using JMP 13 or earlier.&amp;nbsp; The "After" capability was added in JMP 14.&amp;nbsp; Here is alternative way to do what you need&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");

dt4 = New Table("Results");

For(i=1,i&amp;lt;=n rows(dt), i=i+3,
	dt&amp;lt;&amp;lt;select where(Row()&amp;gt;=i &amp;amp; Row()&amp;lt;=i+3);
	dtTemp = dt &amp;lt;&amp;lt; subset(selected rows(1), selected cols(0));
	dt4 &amp;lt;&amp;lt; concatenate(dtTemp, append to first table);
	dt4 &amp;lt;&amp;lt; add rows(1);
	close( dtTemp, nosave );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 18:14:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270279#M52619</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-06-02T18:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Add rows every x rows</title>
      <link>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270292#M52624</link>
      <description>&lt;P&gt;That did the trick.&amp;nbsp; Thanx.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2020 18:52:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-rows-every-x-rows/m-p/270292#M52624</guid>
      <dc:creator>jimloughlin</dc:creator>
      <dc:date>2020-06-02T18:52:42Z</dc:date>
    </item>
  </channel>
</rss>

