<?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 Is there an efficient way to do this circular aggregation? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Is-there-an-efficient-way-to-do-this-circular-aggregation/m-p/661391#M85008</link>
    <description>&lt;P&gt;Use the big class form:&lt;BR /&gt;1. Starting from line 20, extract a subset of the data from this row to the previous 19 rows.&lt;BR /&gt;2. Classify this subset according to age and summarize height and weight.And one by one concatenation summary results.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
j = 1;
For( j = 20, j &amp;lt;= N Row( dt ), j++,
	dt &amp;lt;&amp;lt; Select Where( j - 20 &amp;lt; Row() &amp;lt;= j );
	d3 = dt &amp;lt;&amp;lt; Subset( Output Table( "tab" ), Selected Rows( 1 ), selected columns( 0 ) );
	d1 = d3 &amp;lt;&amp;lt; Summary(
		Sum( height ),
		Sum( weight ),
		Subgroup( age ),
		Freq( 0 ),
		Weight( 0 ),
		Link to original data table( 0 ),
		statistics column name format( "column" )
	);
	If( j == 20,
		d2 = d1;
		d2 &amp;lt;&amp;lt; setName( "tmp" );
	,
		Current Data Table( d2 );
		d2 &amp;lt;&amp;lt; Concatenate( Data Table( d1 ), Append to first table );
		Close( d1, nosave );
	);
	Close( d3, nosave );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 23 Jul 2023 02:47:25 GMT</pubDate>
    <dc:creator>lala</dc:creator>
    <dc:date>2023-07-23T02:47:25Z</dc:date>
    <item>
      <title>Is there an efficient way to do this circular aggregation?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-efficient-way-to-do-this-circular-aggregation/m-p/661391#M85008</link>
      <description>&lt;P&gt;Use the big class form:&lt;BR /&gt;1. Starting from line 20, extract a subset of the data from this row to the previous 19 rows.&lt;BR /&gt;2. Classify this subset according to age and summarize height and weight.And one by one concatenation summary results.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
j = 1;
For( j = 20, j &amp;lt;= N Row( dt ), j++,
	dt &amp;lt;&amp;lt; Select Where( j - 20 &amp;lt; Row() &amp;lt;= j );
	d3 = dt &amp;lt;&amp;lt; Subset( Output Table( "tab" ), Selected Rows( 1 ), selected columns( 0 ) );
	d1 = d3 &amp;lt;&amp;lt; Summary(
		Sum( height ),
		Sum( weight ),
		Subgroup( age ),
		Freq( 0 ),
		Weight( 0 ),
		Link to original data table( 0 ),
		statistics column name format( "column" )
	);
	If( j == 20,
		d2 = d1;
		d2 &amp;lt;&amp;lt; setName( "tmp" );
	,
		Current Data Table( d2 );
		d2 &amp;lt;&amp;lt; Concatenate( Data Table( d1 ), Append to first table );
		Close( d1, nosave );
	);
	Close( d3, nosave );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Jul 2023 02:47:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-efficient-way-to-do-this-circular-aggregation/m-p/661391#M85008</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-07-23T02:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an efficient way to do this circular aggregation?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-efficient-way-to-do-this-circular-aggregation/m-p/661412#M85009</link>
      <description>&lt;P&gt;Structuring your JSL the way you are, you are taking advantage of some nice JMP features.&amp;nbsp; Writing JSL to create your desired output would require a lot of coding.&amp;nbsp; Below, I have made some minor adjustments to your script that might give you a little more efficient script.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
d2 = New Table( "tmp" );
k = 1;
For( k = 20, k &amp;lt;= N Row( dt ), k++,
	dt &amp;lt;&amp;lt; Select Where( k - 20 &amp;lt; Row() &amp;lt;= k );
	d3 = dt &amp;lt;&amp;lt; Subset( Output Table( "tab" ), Selected Rows( 1 ), selected columns( 0 ), private );
	d1 = d3 &amp;lt;&amp;lt; Summary(
		Sum( height ),
		Sum( weight ),
		Subgroup( age ),
		Freq( 0 ),
		Weight( 0 ),
		Link to original data table( 0 ),
		statistics column name format( "column" )
	);
	
	d2 &amp;lt;&amp;lt; Concatenate( Data Table( d1 ), Append to first table );
	Close( d1, nosave );
	Close( d3, nosave );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I changed the name of your index variable called "j".&amp;nbsp; This is to avoid possible confusion.&amp;nbsp; JMP has a function named j().&amp;nbsp; It is a better practice to avoid also having a variable named "j" too.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2023 05:01:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-efficient-way-to-do-this-circular-aggregation/m-p/661412#M85009</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-07-23T05:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an efficient way to do this circular aggregation?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-efficient-way-to-do-this-circular-aggregation/m-p/661417#M85010</link>
      <description>&lt;P&gt;Thank Jim!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I want to use JMP to quickly calculate the chip peak of each stock in different cycles.&lt;/SPAN&gt;&lt;SPAN class=""&gt;It's too computationally intensive.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jul 2023 05:14:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-efficient-way-to-do-this-circular-aggregation/m-p/661417#M85010</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-07-23T05:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an efficient way to do this circular aggregation?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-efficient-way-to-do-this-circular-aggregation/m-p/661420#M85011</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ar=[];ar=J(r,c,0);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Jul 2023 05:19:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-efficient-way-to-do-this-circular-aggregation/m-p/661420#M85011</guid>
      <dc:creator>lala</dc:creator>
      <dc:date>2023-07-23T05:19:24Z</dc:date>
    </item>
  </channel>
</rss>

