<?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: Script for Group by and Fit each value in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/701567#M88616</link>
    <description>&lt;P&gt;Depending on how robust script you want and with what type of reports you want it to work with, you might have to modify this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

rep = Current Report();
obj = rep[OutlineBox(1)] &amp;lt;&amp;lt; Get Scriptable Object;
// might have to add check if you have correct type of report open

obj &amp;lt;&amp;lt; Group By(:Sex);
obj &amp;lt;&amp;lt; Fit Each Value;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Nov 2023 18:56:49 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2023-11-21T18:56:49Z</dc:date>
    <item>
      <title>Script for Group by and Fit each value</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/701547#M88614</link>
      <description>&lt;P&gt;I have a script in the Custom toolbar that turns character columns into numeric, which I use all the time.&lt;/P&gt;
&lt;P&gt;I also use&amp;nbsp;Group by and Fit each value whenever I have a suitable graph ready.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I want a script that, when I already have an x-y graph, does Group by and Fit each value. The below script works as I tried it on Big Class.jmp, but I want it to do just the Group by and Fit each value, on an already existing graph. I guess I need to define obj so that it points to the graph, but how?&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();

obj = dt &amp;lt;&amp;lt; Bivariate(Y(:Weight), X(:Height));
obj &amp;lt;&amp;lt; Group By(:Sex);
obj &amp;lt;&amp;lt; Fit Each Value;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ake_0-1700591711105.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/58997i732C4851ADF90E20/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ake_0-1700591711105.png" alt="Ake_0-1700591711105.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2023 18:53:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/701547#M88614</guid>
      <dc:creator>Ake</dc:creator>
      <dc:date>2023-11-21T18:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Group by and Fit each value</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/701567#M88616</link>
      <description>&lt;P&gt;Depending on how robust script you want and with what type of reports you want it to work with, you might have to modify this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

rep = Current Report();
obj = rep[OutlineBox(1)] &amp;lt;&amp;lt; Get Scriptable Object;
// might have to add check if you have correct type of report open

obj &amp;lt;&amp;lt; Group By(:Sex);
obj &amp;lt;&amp;lt; Fit Each Value;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Nov 2023 18:56:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/701567#M88616</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-21T18:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Group by and Fit each value</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/701915#M88635</link>
      <description>&lt;P&gt;Appears to work wonderfully! Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 09:49:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/701915#M88635</guid>
      <dc:creator>Ake</dc:creator>
      <dc:date>2023-11-22T09:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Group by and Fit each value</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/702249#M88659</link>
      <description>&lt;P&gt;Give me the little finger and I'll take the hand! That worked so good, that now I would like the same thing to work when I have more than one plot in the report, e.g. when I have plotted more than one parameter or by group. Tried experimenting with 'xPath' that I found in the forum, but no success. Syntax is everything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ake_0-1700738060945.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59039i01A74EEBB3856223/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ake_0-1700738060945.png" alt="Ake_0-1700738060945.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 11:15:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/702249#M88659</guid>
      <dc:creator>Ake</dc:creator>
      <dc:date>2023-11-23T11:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Group by and Fit each value</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/702251#M88660</link>
      <description>&lt;P&gt;Send &amp;lt;&amp;lt; get xml message to your object reference (rep in this case). Then from log try to see if there is something what you could use to get access to correct outlineboxes&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1700738625547.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/59040iB154CD60485B5798/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1700738625547.png" alt="jthi_0-1700738625547.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you have JMP17 I think helpKey is usually quite good bet. You could also possibly use outlinebox names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you have those outlinebox references, modify script as needed&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt = Fit Group(
	Bivariate(Y(:height), X(:age)),
	Bivariate(Y(:weight), X(:age)),
	&amp;lt;&amp;lt;{Arrange in Rows(1)}
);

rep = Current Report();

obs = rep &amp;lt;&amp;lt; XPath("//OutlineBox[@helpKey = 'Bivariate Report']");
objs = obs &amp;lt;&amp;lt; Get Scriptable Object;
// might have to add check if you have correct type of report open

objs &amp;lt;&amp;lt; Group By(:Sex);
objs &amp;lt;&amp;lt; Fit Each Value;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Nov 2023 11:26:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-Group-by-and-Fit-each-value/m-p/702251#M88660</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-11-23T11:26:08Z</dc:date>
    </item>
  </channel>
</rss>

