<?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 Multiple Plots and Files using a for loop based on a Group and BY using JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Multiple-Plots-and-Files-using-a-for-loop-based-on-a-Group-and/m-p/87678#M38685</link>
    <description>&lt;P&gt;Have a JMP table with say 5 cols&lt;BR /&gt;ColA is categrical column. ColA has different group of values. Sample data with just 3 groups from Col A&lt;/P&gt;&lt;P&gt;ColA&amp;nbsp; &amp;nbsp;ColB&amp;nbsp; &amp;nbsp; ColC&amp;nbsp; &amp;nbsp; Y&amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;&amp;nbsp; a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; PQR1&lt;BR /&gt;&amp;nbsp; a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p2&amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp;PQR2&lt;BR /&gt;&amp;nbsp; b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p1&amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp;ABC1&lt;BR /&gt;&amp;nbsp; b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p2&amp;nbsp; &amp;nbsp; &amp;nbsp; 14&amp;nbsp; &amp;nbsp;ABC1&lt;BR /&gt;&amp;nbsp; b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p3&amp;nbsp; &amp;nbsp; &amp;nbsp; 19&amp;nbsp; &amp;nbsp;ABC2&lt;BR /&gt;&amp;nbsp; c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p3&amp;nbsp; &amp;nbsp; &amp;nbsp; 16&amp;nbsp; &amp;nbsp;FGT1&lt;BR /&gt;&amp;nbsp; c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22&amp;nbsp; &amp;nbsp;FGT3&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I am trying to create a JSL script which will give me different html files when&lt;/STRONG&gt;&lt;BR /&gt;&lt;U&gt;I do a oneway plot for each group in Col A ( in this example 3). However, I want each of the plots to be split by the Col B &amp;amp; Col C. (Thus for the case of our data above, when ColA is a we will have two plots based on Col B &amp;amp; Col C, 3 plots when ColA is b and 1 plot when Col A is c)&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eventually by goal is to create journal for each ColA group plots and save them individually to html files.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I have written the following script, but unfortunately not getting what I want. I am getting 3 plots pop up,but no plot is having the required number of plots as expected from the By clause for Col B &amp;amp; Col C.&lt;/EM&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;I am getting 3 html files in which I am getting the same plots in each of them.&amp;nbsp; ( &lt;FONT color="#CC99FF"&gt;I may need eval/substitute, which I am not very familiar about&lt;/FONT&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
summarize(colgroup=by(:ColA));

outfile_path = "xxx\";

for (i=1, i&amp;lt;=N items(colgroup),i++, 
 
     idname = Char(colgroup[i]);
     
     outfile  = outfile_path || "_" || idname || ".html";
     
	 grph_obj = dt &amp;lt;&amp;lt; Oneway(
	
	         Y( :Y ),
	         X( :X),
	         Means( 1 ),
	         Box Plots( 1 ),
	         Mean Diamonds( 1 ),
	         By(:ColB, :ColC);
	         Where(:ColA == idname);
			 
	
    ) &amp;lt;&amp;lt; show window(0);

       Wait(1); 

       jrn_grph = New Window("Report Group Col A", &amp;lt;&amp;lt; Journal) ;
	
	   Wait(1);
	
	   grph_obj  &amp;lt;&amp;lt; Journal(Freeze All) &amp;lt;&amp;lt; show window(0);
	
	    Wait(5);
	
	    jrn_grph &amp;lt;&amp;lt; Set page setup(
	        margins( .5, .5, .5, .5 ),
	        scale( .99 ),
	        portrait( 0 ),
	        paper size( "Letter" ) 
        );
	
	    jrn_grph &amp;lt;&amp;lt; Save HTML(outfile); 
		
		Close All (Journals, "No Save");


)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 23:25:35 GMT</pubDate>
    <dc:creator>indymitra</dc:creator>
    <dc:date>2023-06-09T23:25:35Z</dc:date>
    <item>
      <title>Multiple Plots and Files using a for loop based on a Group and BY using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-Plots-and-Files-using-a-for-loop-based-on-a-Group-and/m-p/87678#M38685</link>
      <description>&lt;P&gt;Have a JMP table with say 5 cols&lt;BR /&gt;ColA is categrical column. ColA has different group of values. Sample data with just 3 groups from Col A&lt;/P&gt;&lt;P&gt;ColA&amp;nbsp; &amp;nbsp;ColB&amp;nbsp; &amp;nbsp; ColC&amp;nbsp; &amp;nbsp; Y&amp;nbsp; &amp;nbsp; &amp;nbsp; X&lt;BR /&gt;&amp;nbsp; a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; PQR1&lt;BR /&gt;&amp;nbsp; a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p2&amp;nbsp; &amp;nbsp; &amp;nbsp; 11&amp;nbsp; &amp;nbsp;PQR2&lt;BR /&gt;&amp;nbsp; b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p1&amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp;ABC1&lt;BR /&gt;&amp;nbsp; b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p2&amp;nbsp; &amp;nbsp; &amp;nbsp; 14&amp;nbsp; &amp;nbsp;ABC1&lt;BR /&gt;&amp;nbsp; b&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p3&amp;nbsp; &amp;nbsp; &amp;nbsp; 19&amp;nbsp; &amp;nbsp;ABC2&lt;BR /&gt;&amp;nbsp; c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p3&amp;nbsp; &amp;nbsp; &amp;nbsp; 16&amp;nbsp; &amp;nbsp;FGT1&lt;BR /&gt;&amp;nbsp; c&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;p3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22&amp;nbsp; &amp;nbsp;FGT3&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I am trying to create a JSL script which will give me different html files when&lt;/STRONG&gt;&lt;BR /&gt;&lt;U&gt;I do a oneway plot for each group in Col A ( in this example 3). However, I want each of the plots to be split by the Col B &amp;amp; Col C. (Thus for the case of our data above, when ColA is a we will have two plots based on Col B &amp;amp; Col C, 3 plots when ColA is b and 1 plot when Col A is c)&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eventually by goal is to create journal for each ColA group plots and save them individually to html files.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I have written the following script, but unfortunately not getting what I want. I am getting 3 plots pop up,but no plot is having the required number of plots as expected from the By clause for Col B &amp;amp; Col C.&lt;/EM&gt;&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;I am getting 3 html files in which I am getting the same plots in each of them.&amp;nbsp; ( &lt;FONT color="#CC99FF"&gt;I may need eval/substitute, which I am not very familiar about&lt;/FONT&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
summarize(colgroup=by(:ColA));

outfile_path = "xxx\";

for (i=1, i&amp;lt;=N items(colgroup),i++, 
 
     idname = Char(colgroup[i]);
     
     outfile  = outfile_path || "_" || idname || ".html";
     
	 grph_obj = dt &amp;lt;&amp;lt; Oneway(
	
	         Y( :Y ),
	         X( :X),
	         Means( 1 ),
	         Box Plots( 1 ),
	         Mean Diamonds( 1 ),
	         By(:ColB, :ColC);
	         Where(:ColA == idname);
			 
	
    ) &amp;lt;&amp;lt; show window(0);

       Wait(1); 

       jrn_grph = New Window("Report Group Col A", &amp;lt;&amp;lt; Journal) ;
	
	   Wait(1);
	
	   grph_obj  &amp;lt;&amp;lt; Journal(Freeze All) &amp;lt;&amp;lt; show window(0);
	
	    Wait(5);
	
	    jrn_grph &amp;lt;&amp;lt; Set page setup(
	        margins( .5, .5, .5, .5 ),
	        scale( .99 ),
	        portrait( 0 ),
	        paper size( "Letter" ) 
        );
	
	    jrn_grph &amp;lt;&amp;lt; Save HTML(outfile); 
		
		Close All (Journals, "No Save");


)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:25:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-Plots-and-Files-using-a-for-loop-based-on-a-Group-and/m-p/87678#M38685</guid>
      <dc:creator>indymitra</dc:creator>
      <dc:date>2023-06-09T23:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Plots and Files using a for loop based on a Group and BY using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-Plots-and-Files-using-a-for-loop-based-on-a-Group-and/m-p/87699#M38697</link>
      <description>&lt;P&gt;I have not tested it but I think the&amp;nbsp;code would&amp;nbsp;work&amp;nbsp;as intended with a comma instead of semicolon after&amp;nbsp;&lt;EM&gt;By(:ColB, :ColC).&lt;/EM&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>Thu, 03 Jan 2019 19:58:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-Plots-and-Files-using-a-for-loop-based-on-a-Group-and/m-p/87699#M38697</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2019-01-03T19:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Plots and Files using a for loop based on a Group and BY using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Multiple-Plots-and-Files-using-a-for-loop-based-on-a-Group-and/m-p/87706#M38702</link>
      <description>Wow!!! Perfect!! Yes it works with the comma instead of semicolon.. That's a good thing to know!</description>
      <pubDate>Thu, 03 Jan 2019 20:26:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Multiple-Plots-and-Files-using-a-for-loop-based-on-a-Group-and/m-p/87706#M38702</guid>
      <dc:creator>indymitra</dc:creator>
      <dc:date>2019-01-03T20:26:04Z</dc:date>
    </item>
  </channel>
</rss>

