<?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: Help With adding Data Tables in Journals using a loop. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186514#M40489</link>
    <description>&lt;P&gt;There are multiple methods to do this. Look up Help &amp;gt; Scripting Index &amp;gt; DataTableColBox for an alternative method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is one method&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = Open("$sample_data/Big Class.jmp");

//get the group list

Summarize(Data Table(dt), grps = By(:sex, :age) );

show(grps);  //List of 2 lists of equal size, the first list's items are gender, the second age

ob = OutlineBox("Subset Tables", vl=VListBox() );

For(i=1, i&amp;lt;=nitems(grps[1]), i++,  //can also use grps[2] 
 ttl = EvalInsert("Sex = ^grps[1][i]^, Age = ^grps[2][i]^");
 
 //note Summarize lists converts numeric to character so num() function is required
 //If the grouping columns are character, this is not needed.
 
 dt &amp;lt;&amp;lt; Select Where(:sex==grps[1][i] &amp;amp; :age==num(grps[2][i]) );
 odt= (dt &amp;lt;&amp;lt; Subset( Invisible, Output Table( ttl ),
	Selected Rows( 1 ),
	Selected columns only( 0 ))
 );
 dg = odt &amp;lt;&amp;lt; New Data Box();
 tmp = OutlineBox( ttl, dg);
 tmp &amp;lt;&amp;lt; close(1);
 vl &amp;lt;&amp;lt; append(tmp);  
 dt &amp;lt;&amp;lt; clear select;   	
); // end for

//ob hase a nice table like view of each subset, but once you close the tables the view is gone
//so journaling creates te report view, and the subsetted tables can be closed.

nw = New Window("Tables", &amp;lt;&amp;lt;Journal);
ob &amp;lt;&amp;lt; Journal;
Close All(Data Tables, Invisible, NoSave); &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Mar 2019 21:41:21 GMT</pubDate>
    <dc:creator>gzmorgan0</dc:creator>
    <dc:date>2019-03-12T21:41:21Z</dc:date>
    <item>
      <title>Help With adding Data Tables in Journals using a loop.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186501#M40485</link>
      <description>&lt;P&gt;Hi, I am new to JMP. I am tryiing to add tables generated by a loop into journal. But not having much luck. Any help with this would be appreciated. Here is my script. My initial table is being genarated by running SQL qurey.&amp;nbsp;&lt;/P&gt;&lt;P&gt;dt2 = dt&amp;lt;&amp;lt;Summary(&lt;BR /&gt;Group( :MODULE, :STEP ),&lt;BR /&gt;Freq( "None" ),&lt;BR /&gt;Weight( "None" )&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;ModuleList = Column(dt2,"MODULE")&amp;lt;&amp;lt;Get Values;&lt;BR /&gt;StepList = Column(dt2,"STEP")&amp;lt;&amp;lt;Get Values;&lt;BR /&gt;numrows= nrows(dt2);&lt;BR /&gt;Close(dt2,nosave);&lt;/P&gt;&lt;P&gt;For (i=1, i&amp;lt;=numrows, i++,&lt;BR /&gt;dt&amp;lt;&amp;lt; select Where (:MODULE==ModuleList[i] &amp;amp; :STEP==StepList[i]);&lt;BR /&gt;odt= (dt &amp;lt;&amp;lt; Subset(&lt;BR /&gt;Output Table( ModuleList[i] ),&lt;BR /&gt;Selected Rows( 1 ),&lt;BR /&gt;Selected columns only( 0 )));&lt;BR /&gt;dt&amp;lt;&amp;lt; clear select;&lt;BR /&gt;jrn&amp;lt;&amp;lt; Append(Text Box(ModuleList[i])); //Currently I am just adding the tables to journal.&lt;BR /&gt;odt&amp;lt;&amp;lt; journal; //However I would like to add them as Collesapble window/ListBox with ModuleList[i] as the title.&lt;BR /&gt;Close(odt,nosave);&lt;BR /&gt;&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 20:13:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186501#M40485</guid>
      <dc:creator>sagarnyc</dc:creator>
      <dc:date>2019-03-12T20:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help With adding Data Tables in Journals using a loop.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186514#M40489</link>
      <description>&lt;P&gt;There are multiple methods to do this. Look up Help &amp;gt; Scripting Index &amp;gt; DataTableColBox for an alternative method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is one method&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

dt = Open("$sample_data/Big Class.jmp");

//get the group list

Summarize(Data Table(dt), grps = By(:sex, :age) );

show(grps);  //List of 2 lists of equal size, the first list's items are gender, the second age

ob = OutlineBox("Subset Tables", vl=VListBox() );

For(i=1, i&amp;lt;=nitems(grps[1]), i++,  //can also use grps[2] 
 ttl = EvalInsert("Sex = ^grps[1][i]^, Age = ^grps[2][i]^");
 
 //note Summarize lists converts numeric to character so num() function is required
 //If the grouping columns are character, this is not needed.
 
 dt &amp;lt;&amp;lt; Select Where(:sex==grps[1][i] &amp;amp; :age==num(grps[2][i]) );
 odt= (dt &amp;lt;&amp;lt; Subset( Invisible, Output Table( ttl ),
	Selected Rows( 1 ),
	Selected columns only( 0 ))
 );
 dg = odt &amp;lt;&amp;lt; New Data Box();
 tmp = OutlineBox( ttl, dg);
 tmp &amp;lt;&amp;lt; close(1);
 vl &amp;lt;&amp;lt; append(tmp);  
 dt &amp;lt;&amp;lt; clear select;   	
); // end for

//ob hase a nice table like view of each subset, but once you close the tables the view is gone
//so journaling creates te report view, and the subsetted tables can be closed.

nw = New Window("Tables", &amp;lt;&amp;lt;Journal);
ob &amp;lt;&amp;lt; Journal;
Close All(Data Tables, Invisible, NoSave); &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 21:41:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186514#M40489</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-03-12T21:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help With adding Data Tables in Journals using a loop.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186516#M40490</link>
      <description>&lt;P&gt;Here is a screenshot of the Journal, with the last table opened.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 548px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/16271iDBB6B1D2766C7BF3/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 21:44:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186516#M40490</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-03-12T21:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help With adding Data Tables in Journals using a loop.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186682#M40514</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/70"&gt;@gzmorgan0&lt;/a&gt;&amp;nbsp;, Thank you for your reply. The solution was perfect. I just have one question. Is there a way to size the boxes(Outlinebox) so that the texts within the boxes stay in one line.&lt;BR /&gt;Thank you again for your time and help.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 14:30:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186682#M40514</guid>
      <dc:creator>sagarnyc</dc:creator>
      <dc:date>2019-03-13T14:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help With adding Data Tables in Journals using a loop.</title>
      <link>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186924#M40545</link>
      <description>&lt;P&gt;Instead of a VListBox, use a LineUpBox, that should help if the table titles are of different length.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the tables are not subsets of teh same table, meaning the tables have varying number of columns, the only way I know how to do that is to use a container like a PanelBox for each of the tables. Find the larget width, then set each panel box the same width.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully, the LineupBox will be all that you need.&amp;nbsp; The changed script is attached.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 10:01:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-With-adding-Data-Tables-in-Journals-using-a-loop/m-p/186924#M40545</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-03-14T10:01:37Z</dc:date>
    </item>
  </channel>
</rss>

