<?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: Looping Summary Tables in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Looping-Summary-Tables/m-p/432626#M68234</link>
    <description>&lt;OL&gt;&lt;LI&gt;Is there a specific name for needing summary 1, summary 2... and so on name?&lt;/LI&gt;&lt;LI&gt;If you have specific names you can use those, but I would advice against it and use references.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here is an example with Big Class how to use references&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt_list = dt &amp;lt;&amp;lt; Subset(
	By(:sex),
	All rows,
	Selected columns only(0),
	columns(:name, :age, :height, :weight)
);
show(dt_list);

//add dt to dt_list
Insert into(dt_list, dt);
show(dt_list);

//create list to collect summary tables
dt_summary_list = {}; 

//will require JMP16 due to For Each. For Each can be replöaced with for loop
For Each({val, idx}, dt_list,
	dt_summary = val &amp;lt;&amp;lt; Summary(
		output table("Summary " || char(idx)), //we can use output table() to define name
		//output table("Summary"), //you could also let jmp take care of naming
		Group(:age),
		Mean(:height),
		Freq("None"),
		Weight("None")
	);
	Insert Into(dt_summary_list, dt_summary);
);

Show(dt_summary_list[2]); //should use list and indices rather than "hardcoded" names
summary_of_summary = Datatable("Summary 2") &amp;lt;&amp;lt; Summary(
	output table("SummaryOfSummary2"),
	Mean(:"Mean(height)"n),
	Freq("None"),
	Weight("None")
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1635950682876.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/37244i350B03F08184EC09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1635950682876.png" alt="jthi_0-1635950682876.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Nov 2021 14:45:44 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-11-03T14:45:44Z</dc:date>
    <item>
      <title>Looping Summary Tables</title>
      <link>https://community.jmp.com/t5/Discussions/Looping-Summary-Tables/m-p/432507#M68224</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am trying to summarize multiple table but I need it to be in a loop form.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. How can I loop the output table name to be in uniform name (eg. summary 1, summary 2)&lt;/P&gt;&lt;P&gt;2. How can I loop the following output table again for another summary&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please Help. TIA&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:39:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Looping-Summary-Tables/m-p/432507#M68224</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-06-10T23:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Looping Summary Tables</title>
      <link>https://community.jmp.com/t5/Discussions/Looping-Summary-Tables/m-p/432626#M68234</link>
      <description>&lt;OL&gt;&lt;LI&gt;Is there a specific name for needing summary 1, summary 2... and so on name?&lt;/LI&gt;&lt;LI&gt;If you have specific names you can use those, but I would advice against it and use references.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here is an example with Big Class how to use references&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt_list = dt &amp;lt;&amp;lt; Subset(
	By(:sex),
	All rows,
	Selected columns only(0),
	columns(:name, :age, :height, :weight)
);
show(dt_list);

//add dt to dt_list
Insert into(dt_list, dt);
show(dt_list);

//create list to collect summary tables
dt_summary_list = {}; 

//will require JMP16 due to For Each. For Each can be replöaced with for loop
For Each({val, idx}, dt_list,
	dt_summary = val &amp;lt;&amp;lt; Summary(
		output table("Summary " || char(idx)), //we can use output table() to define name
		//output table("Summary"), //you could also let jmp take care of naming
		Group(:age),
		Mean(:height),
		Freq("None"),
		Weight("None")
	);
	Insert Into(dt_summary_list, dt_summary);
);

Show(dt_summary_list[2]); //should use list and indices rather than "hardcoded" names
summary_of_summary = Datatable("Summary 2") &amp;lt;&amp;lt; Summary(
	output table("SummaryOfSummary2"),
	Mean(:"Mean(height)"n),
	Freq("None"),
	Weight("None")
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1635950682876.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/37244i350B03F08184EC09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1635950682876.png" alt="jthi_0-1635950682876.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 14:45:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Looping-Summary-Tables/m-p/432626#M68234</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-11-03T14:45:44Z</dc:date>
    </item>
  </channel>
</rss>

