<?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 Help for Fit Y by X using For Loop in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-for-Fit-Y-by-X-using-For-Loop/m-p/219317#M43901</link>
    <description>&lt;P&gt;Hi all, hope somebody can help me with this request,&amp;nbsp;I am trying to write a JSL script to create multiple Analysis Fit Y to X using a where condition, then&amp;nbsp;I need to save every analysis generated with the values of the column used for Where as JPEG file.&lt;/P&gt;&lt;P&gt;So far, this is my initial script but I noticed that I am just creating a repeated analysis (times the tools used for&amp;nbsp; "Where"), I guess my error is somewhere on how I specify the N items. I am adding also a sample table for the data.&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Names Default To Here( 1 );&lt;BR /&gt;dt = Current Data Table();&lt;BR /&gt;summarize(groupid = by(:TOOL));&lt;BR /&gt;show (groupid);&lt;/P&gt;&lt;P&gt;For( i = 1, i &amp;lt;= N Items( groupid ), i++,&lt;/P&gt;&lt;P&gt;pic = dt &amp;lt;&amp;lt; Oneway(&lt;BR /&gt;Y( :Measure ),&lt;BR /&gt;X( :Processdate ),&lt;BR /&gt;Where ( :TOOL == groupid [i]);&lt;BR /&gt;pic &amp;lt;&amp;lt; Save Picture( "E:\Sample\FitYbyX_" || groupid[i] ||".jpg", JPEG );&lt;BR /&gt;););&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jul 2019 13:51:35 GMT</pubDate>
    <dc:creator>AndresGlez</dc:creator>
    <dc:date>2019-07-31T13:51:35Z</dc:date>
    <item>
      <title>Help for Fit Y by X using For Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Help-for-Fit-Y-by-X-using-For-Loop/m-p/219317#M43901</link>
      <description>&lt;P&gt;Hi all, hope somebody can help me with this request,&amp;nbsp;I am trying to write a JSL script to create multiple Analysis Fit Y to X using a where condition, then&amp;nbsp;I need to save every analysis generated with the values of the column used for Where as JPEG file.&lt;/P&gt;&lt;P&gt;So far, this is my initial script but I noticed that I am just creating a repeated analysis (times the tools used for&amp;nbsp; "Where"), I guess my error is somewhere on how I specify the N items. I am adding also a sample table for the data.&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Names Default To Here( 1 );&lt;BR /&gt;dt = Current Data Table();&lt;BR /&gt;summarize(groupid = by(:TOOL));&lt;BR /&gt;show (groupid);&lt;/P&gt;&lt;P&gt;For( i = 1, i &amp;lt;= N Items( groupid ), i++,&lt;/P&gt;&lt;P&gt;pic = dt &amp;lt;&amp;lt; Oneway(&lt;BR /&gt;Y( :Measure ),&lt;BR /&gt;X( :Processdate ),&lt;BR /&gt;Where ( :TOOL == groupid [i]);&lt;BR /&gt;pic &amp;lt;&amp;lt; Save Picture( "E:\Sample\FitYbyX_" || groupid[i] ||".jpg", JPEG );&lt;BR /&gt;););&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 13:51:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-for-Fit-Y-by-X-using-For-Loop/m-p/219317#M43901</guid>
      <dc:creator>AndresGlez</dc:creator>
      <dc:date>2019-07-31T13:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help for Fit Y by X using For Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Help-for-Fit-Y-by-X-using-For-Loop/m-p/219332#M43904</link>
      <description>&lt;P&gt;I think it might be better to use :TOOL in the By role and then iterate over the results:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = Current Data Table();

Summarize( groupid = by( :TOOL ) );
Show( groupid );

ow = dt &amp;lt;&amp;lt; Oneway( Y( :Measure ), X( :Processdate ), By( :TOOL ) );
	
For( i = 1, i &amp;lt;= N Items( groupid ), i++,
	pic = ow[i] &amp;lt;&amp;lt; Save Picture( "E:\Sample\FitYbyX_" || groupid[i] || ".jpg", JPEG )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Jul 2019 14:27:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-for-Fit-Y-by-X-using-For-Loop/m-p/219332#M43904</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-07-31T14:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help for Fit Y by X using For Loop</title>
      <link>https://community.jmp.com/t5/Discussions/Help-for-Fit-Y-by-X-using-For-Loop/m-p/219496#M43926</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp; this is exactly what I need.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2019 22:07:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-for-Fit-Y-by-X-using-For-Loop/m-p/219496#M43926</guid>
      <dc:creator>AndresGlez</dc:creator>
      <dc:date>2019-07-31T22:07:35Z</dc:date>
    </item>
  </channel>
</rss>

