<?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 How to Append One Report from Data Table A followed by Another Report from Data Table B through For Loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-Append-One-Report-from-Data-Table-A-followed-by-Another/m-p/415358#M66446</link>
    <description>&lt;P&gt;I have two different data tables, A and B. There is one column from each data table has similar variable.&lt;/P&gt;&lt;P&gt;I create subset from each data table A and B by column that has similar variable using separate For loop to create table report and append it into one new window.&lt;/P&gt;&lt;P&gt;I notice that all the table reports created from subset data table A are appended into new window and followed by all the table reports from subset data table B.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is to append one table report from&amp;nbsp;subset data table A followed by&amp;nbsp;table report from&amp;nbsp;subset data table B for each variable level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I write the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Big Class and Big Class Families data set as an example to illustrate this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );

vb = V List Box();
listdt1 = {};
listdt2 = {};
coldt1 = Column (dt1, "age");
coldt2 = Column (dt2, "age");
colleveldt1 = Associative Array(coldt1) &amp;lt;&amp;lt; Get Keys;
colleveldt2 = Associative Array(coldt1) &amp;lt;&amp;lt; Get Keys;

For (i=1, i &amp;lt;=N Items(colleveldt1), i++,
	dt1row = dt1 &amp;lt;&amp;lt; Get Rows Where(:age == colleveldt1[i]);
	listdt1[i] = dt1 &amp;lt;&amp;lt; Subset(Rows(dt1row));
	tb = listdt1[i]&amp;lt;&amp;lt; Get As Report;
	vb &amp;lt;&amp;lt; Append (Table Box(tb));

);
	
For (i=1, i &amp;lt;=N Items(colleveldt2), i++,
	dt2row = dt2 &amp;lt;&amp;lt; Get Rows Where(:age == colleveldt2[i]);
	listdt2[i] = dt2 &amp;lt;&amp;lt; Subset(Rows(dt2row));
	tb = listdt2[i]&amp;lt;&amp;lt; Get As Report;
	vb &amp;lt;&amp;lt; Append (Table Box(tb));
	
	
);

New Window("Report", vb);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 19:55:58 GMT</pubDate>
    <dc:creator>bzanos</dc:creator>
    <dc:date>2023-06-09T19:55:58Z</dc:date>
    <item>
      <title>How to Append One Report from Data Table A followed by Another Report from Data Table B through For Loop</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Append-One-Report-from-Data-Table-A-followed-by-Another/m-p/415358#M66446</link>
      <description>&lt;P&gt;I have two different data tables, A and B. There is one column from each data table has similar variable.&lt;/P&gt;&lt;P&gt;I create subset from each data table A and B by column that has similar variable using separate For loop to create table report and append it into one new window.&lt;/P&gt;&lt;P&gt;I notice that all the table reports created from subset data table A are appended into new window and followed by all the table reports from subset data table B.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is to append one table report from&amp;nbsp;subset data table A followed by&amp;nbsp;table report from&amp;nbsp;subset data table B for each variable level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should I write the code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using Big Class and Big Class Families data set as an example to illustrate this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );

vb = V List Box();
listdt1 = {};
listdt2 = {};
coldt1 = Column (dt1, "age");
coldt2 = Column (dt2, "age");
colleveldt1 = Associative Array(coldt1) &amp;lt;&amp;lt; Get Keys;
colleveldt2 = Associative Array(coldt1) &amp;lt;&amp;lt; Get Keys;

For (i=1, i &amp;lt;=N Items(colleveldt1), i++,
	dt1row = dt1 &amp;lt;&amp;lt; Get Rows Where(:age == colleveldt1[i]);
	listdt1[i] = dt1 &amp;lt;&amp;lt; Subset(Rows(dt1row));
	tb = listdt1[i]&amp;lt;&amp;lt; Get As Report;
	vb &amp;lt;&amp;lt; Append (Table Box(tb));

);
	
For (i=1, i &amp;lt;=N Items(colleveldt2), i++,
	dt2row = dt2 &amp;lt;&amp;lt; Get Rows Where(:age == colleveldt2[i]);
	listdt2[i] = dt2 &amp;lt;&amp;lt; Subset(Rows(dt2row));
	tb = listdt2[i]&amp;lt;&amp;lt; Get As Report;
	vb &amp;lt;&amp;lt; Append (Table Box(tb));
	
	
);

New Window("Report", vb);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:55:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Append-One-Report-from-Data-Table-A-followed-by-Another/m-p/415358#M66446</guid>
      <dc:creator>bzanos</dc:creator>
      <dc:date>2023-06-09T19:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to Append One Report from Data Table A followed by Another Report from Data Table B through For Loop</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Append-One-Report-from-Data-Table-A-followed-by-Another/m-p/415450#M66450</link>
      <description>&lt;P&gt;A simple moving of the JSL gets you what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = Open( "$SAMPLE_DATA/Big Class Families.jmp" );

vb = V List Box();
listdt1 = {};
listdt2 = {};
coldt1 = Column (dt1, "age");
coldt2 = Column (dt2, "age");
colleveldt1 = Associative Array(coldt1) &amp;lt;&amp;lt; Get Keys;
colleveldt2 = Associative Array(coldt1) &amp;lt;&amp;lt; Get Keys;

For (i=1, i &amp;lt;=N Items(colleveldt1), i++,
	dt1row = dt1 &amp;lt;&amp;lt; Get Rows Where(:age == colleveldt1[i]);
	listdt1[i] = dt1 &amp;lt;&amp;lt; Subset(Rows(dt1row),invisible);
	tb = listdt1[i]&amp;lt;&amp;lt; Get As Report;
	vb &amp;lt;&amp;lt; Append (Table Box(tb));
dt2row = dt2 &amp;lt;&amp;lt; Get Rows Where(:age == colleveldt2[i]);
	listdt2[i] = dt2 &amp;lt;&amp;lt; Subset(Rows(dt2row),invisible);
	tb = listdt2[i]&amp;lt;&amp;lt; Get As Report;
	vb &amp;lt;&amp;lt; Append (Table Box(tb));
);

New Window("Report", vb);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Sep 2021 18:46:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Append-One-Report-from-Data-Table-A-followed-by-Another/m-p/415450#M66450</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-03T18:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to Append One Report from Data Table A followed by Another Report from Data Table B through For Loop</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-Append-One-Report-from-Data-Table-A-followed-by-Another/m-p/415519#M66458</link>
      <description>Thanks.</description>
      <pubDate>Sat, 04 Sep 2021 04:17:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-Append-One-Report-from-Data-Table-A-followed-by-Another/m-p/415519#M66458</guid>
      <dc:creator>bzanos</dc:creator>
      <dc:date>2021-09-04T04:17:27Z</dc:date>
    </item>
  </channel>
</rss>

