<?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: How to loop tabulated tables and images into ppt slides in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683940#M86962</link>
    <description>&lt;P&gt;I do not have JMP 16 yet, I tried converting For Each loop to For loop but I don't get any output&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For (i = 1, i &amp;lt;= dataTableList, i++,
	dt_Tab = table &amp;lt;&amp;lt; Tabulate(
		Add Table(
			Column Table( Grouping Columns( :Sex ), Analysis Columns( :height ) ),
			Row Table( Grouping Columns( :name, :age ) )
		)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 05 Oct 2023 01:16:17 GMT</pubDate>
    <dc:creator>UserID16644</dc:creator>
    <dc:date>2023-10-05T01:16:17Z</dc:date>
    <item>
      <title>How to loop tabulated tables and images into ppt slides</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683642#M86922</link>
      <description>&lt;P&gt;Hi, I am kinda stuck and struggling in JMP looping. How can I loop a tabulated table that came from my subset tables? The number of tables may change so I figured that I needed to do looping (but Im struggling) also I need this images appended to powerpoint slides. I don't have an idea how to get looped variable name and append it to the slides.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my sample script, but doesn't have any looping. Is it possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

:Sex &amp;lt;&amp;lt; Set Name( "Sex_Subset" );
dt &amp;lt;&amp;lt; New Column( "Sex", Formula(:Sex_Subset));

dt1 = dt &amp;lt;&amp;lt; Subset( By( :Sex_Subset ), All rows, Selected columns only( 0 ) );

//this is where to loop tabulated tables since column values used in subsetting dt may change number of values
 
//how to loop this according to data table name? is that possible?
dt_Tab = Tabulate(
	Add Table(
		Column Table( Grouping Columns( :Sex ), Analysis Columns( :height ) ),
		Row Table( Grouping Columns( :name, :age ) )
	)
);

tab = dt_Tab &amp;lt;&amp;lt; get picture; //variable name needs to be looped? for ppt slides


//after getting the plot as image, how can I append those images that were loop to ppt slides?

//for male table
hbppt1 = H List Box(tab) &amp;lt;&amp;lt; get picture;
ppt1 = Outline Box( "Male", hbppt1 );
ppt1 &amp;lt;&amp;lt; savepresentation( pathppt, append, PNG );

//for female table
hbppt2 = H List Box(tab2) &amp;lt;&amp;lt; get picture;
ppt2 = Outline Box( "Female", hbppt2 );
ppt2 &amp;lt;&amp;lt; savepresentation( pathppt, append, PNG );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;tables from subset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 08:22:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683642#M86922</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-10-04T08:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop tabulated tables and images into ppt slides</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683657#M86923</link>
      <description>&lt;P&gt;If you use Subset with By, you will get a list of tables which you can then loop over&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = {DataTable("Sex_Subset=F"), DataTable("Sex_Subset=M")};
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;Check scripting index for your functions and messages you are using, some of them are incorrect&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

pathppt = "$TEMP/bigclass.pptx";

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "Sex") &amp;lt;&amp;lt; Set Name("Sex_Subset");
dt &amp;lt;&amp;lt; New Column("Sex", Formula(:Sex_Subset));

dt_subsets = dt &amp;lt;&amp;lt; Subset(By(:Sex_Subset), All rows, Selected columns only(0));

For Each({dt_subset}, dt_subsets,
	subset_tab = dt_subset &amp;lt;&amp;lt; Tabulate(
		Add Table(
			Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
			Row Table(Grouping Columns(:name, :age))
		)
	);

	tab_pic = subset_tab &amp;lt;&amp;lt; get picture; 
	subset_tab &amp;lt;&amp;lt; Close Window;
	name_dt = dt_subset &amp;lt;&amp;lt; get name;
	Close(, no save);
	hbppt = H List Box(tab_pic) &amp;lt;&amp;lt; get picture;
	ppt = Outline Box(name_dt, hbppt);
	If(!File Exists(pathppt), 
		ppt &amp;lt;&amp;lt; savepresentation(pathppt);
	, // append only if file already exists
		ppt &amp;lt;&amp;lt; savepresentation(pathppt, append);
	);
);
 
Open(pathppt);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Oct 2023 08:47:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683657#M86923</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-04T08:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop tabulated tables and images into ppt slides</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683670#M86925</link>
      <description>&lt;P&gt;Here is a rework of your script that creates the slides&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1696412637351.png" style="width: 807px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57199i3CBF3DD5032F5769/image-dimensions/807x456?v=v2" width="807" height="456" role="button" title="txnelson_0-1696412637351.png" alt="txnelson_0-1696412637351.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// Specify the path to save the pptx's to
pathPPT = "$TEMP/UserID16644Slides.pptx";

:Sex &amp;lt;&amp;lt; Set Name( "Sex_Subset" );
dt &amp;lt;&amp;lt; New Column( "Sex", Formula( :Sex_Subset ) );

// Add value labels so the full value can be used for the slide title
dt:Sex_Subset &amp;lt;&amp;lt; Value Labels( {"F" = "Female", "M" = "Male"} ) &amp;lt;&amp;lt; Use Value Labels( 1 );

// Subset the tables.  The dataTableList will contain a reference to each table created
dataTableList = dt &amp;lt;&amp;lt; Subset( By( :Sex_Subset ), All rows, Selected columns only( 0 ) );

// Loop across all of the tables and create the Tabulates
For Each( {table, i}, dataTableList, 

	dt_Tab = table &amp;lt;&amp;lt; Tabulate(
		Add Table(
			Column Table( Grouping Columns( :Sex ), Analysis Columns( :height ) ),
			Row Table( Grouping Columns( :name, :age ) )
		)
	);

	// Pull the subset name from the data table name
	theTitle = Word( 3, Char( dataTableList[i] ), "\!"=" );
	
	// Create the new slide
	hbppt1 = H List Box( dt_tab  &amp;lt;&amp;lt; get picture);
	ppt1 = Outline Box( theTitle, hbppt1 );
	
	// The pptx must exist for the append to be used, so on the first
	// slide it is not appended
	if(i==1,
		ppt1 &amp;lt;&amp;lt; savepresentation( pathppt,"PNG" ),
		ppt1 &amp;lt;&amp;lt; savepresentation( pathppt, Append,"PNG" )
	);
);

// Open the powerpoint presentation to see the results
open(pathppt);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 09:44:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683670#M86925</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-04T09:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop tabulated tables and images into ppt slides</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683940#M86962</link>
      <description>&lt;P&gt;I do not have JMP 16 yet, I tried converting For Each loop to For loop but I don't get any output&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For (i = 1, i &amp;lt;= dataTableList, i++,
	dt_Tab = table &amp;lt;&amp;lt; Tabulate(
		Add Table(
			Column Table( Grouping Columns( :Sex ), Analysis Columns( :height ) ),
			Row Table( Grouping Columns( :name, :age ) )
		)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2023 01:16:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683940#M86962</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-10-05T01:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop tabulated tables and images into ppt slides</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683941#M86963</link>
      <description>&lt;P&gt;Hi, I tried converting the For Each loop to For but doesn't get an output&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For (i = 1, i &amp;lt;= dt_subsets, i++,
	subset_tab = dt_subset &amp;lt;&amp;lt; Tabulate(
		Add Table(
			Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
			Row Table(Grouping Columns(:name, :age))
		)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2023 01:18:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683941#M86963</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-10-05T01:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop tabulated tables and images into ppt slides</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683945#M86964</link>
      <description>&lt;P&gt;dt_subsets is a JMP list.&amp;nbsp; what you need is the number of elements in the list.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For (i = 1, i &amp;lt;= N Items( dt_subsets ), i++,
	subset_tab = dt_subsets &amp;lt;&amp;lt; Tabulate(
		Add Table(
			Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
			Row Table(Grouping Columns(:name, :age))
		)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2023 02:43:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683945#M86964</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-05T02:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop tabulated tables and images into ppt slides</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683952#M86966</link>
      <description>&lt;P&gt;I see. Also, just wondering where did dt_subset came from?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UserID16644_0-1696472716119.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57228i48B25498E856EC6A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="UserID16644_0-1696472716119.png" alt="UserID16644_0-1696472716119.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because as I tried this line of code, dt_subset (&lt;CODE class=" language-jsl"&gt;dt_subset &amp;lt;&amp;lt; Tabulate()&lt;/CODE&gt;&amp;nbsp;)is not found. However, I tried replacing it with dt_subsets, it tabulated the tables 2x (2 tabulated tables for male and 2 for female)&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For (i = 1, i &amp;lt;= N Items( dt_subsets ), i++,
	subset_tab = dt_subset &amp;lt;&amp;lt; Tabulate(
		Add Table(
			Column Table(Grouping Columns(:Sex), Analysis Columns(:height)),
			Row Table(Grouping Columns(:name, :age))
		)
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2023 02:27:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683952#M86966</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-10-05T02:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop tabulated tables and images into ppt slides</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683956#M86967</link>
      <description>&lt;P&gt;It needs to be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For (i = 1, i &amp;lt;= N Items( dataTableList ), i++,&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2023 02:42:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683956#M86967</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-05T02:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to loop tabulated tables and images into ppt slides</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683957#M86968</link>
      <description>&lt;P&gt;The variable&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dt_subset&lt;/P&gt;
&lt;P&gt;is an error, it needs to be&lt;/P&gt;
&lt;P&gt;dt_subsets&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 02:44:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-loop-tabulated-tables-and-images-into-ppt-slides/m-p/683957#M86968</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-05T02:44:59Z</dc:date>
    </item>
  </channel>
</rss>

