<?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 to rename a table coming from the Contingency Table option : Make Into Data Table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684081#M86980</link>
    <description>&lt;P&gt;You need to use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt_cont &amp;lt;&amp;lt; set Name("Contingency Table")&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 05 Oct 2023 09:49:31 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-10-05T09:49:31Z</dc:date>
    <item>
      <title>Script to rename a table coming from the Contingency Table option : Make Into Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684024#M86973</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made a code to obtain a data table with contingency table tool information, unfortunately, the table issued is named "Untitled xxx". I would like to know if by scripting it will be possible either to select the last table created and change its name, or to select the table containing Untitled in its name, to rename it at the end ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The objective is to close the table at each launch if the script to avoid having several tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use Current Data Table () function but it does not work properly (another table is selected).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code section :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Contingency(
	Y( :"Pass/Fail"n ),
	X( :Task ),
	Contingency Table(
		Count( 1, Format( "Fixed Dec", 2, 0 ) ),
		Total %( 1, Format( "Fixed Dec", 2, 2 ) ),
		Col %( 1, Format( "Fixed Dec", 2, 2 ) ),
		Row %( 1, Format( "Fixed Dec", 2, 2 ) ),
		Expected( 0, Format( "Best", 3 ) ),
		Deviation( 0, Format( "Best", 3 ) ),
		Cell Chi Square( 0, Format( "Fixed Dec", 2, 4 ) ),
		Col cumulative( 0, Format( "Fixed Dec", 2, 0 ) ),
		Col cumulative %( 0, Format( "Fixed Dec", 2, 2 ) ),
		Row cumulative( 0, Format( "Fixed Dec", 2, 0 ) ),
		Row cumulative %( 0, Format( "Fixed Dec", 2, 2 ) )
	),
	Mosaic Plot( 0 ),
	Make Into Data Table,
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 08:30:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684024#M86973</guid>
      <dc:creator>Arkawa</dc:creator>
      <dc:date>2023-10-05T08:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script to rename a table coming from the Contingency Table option : Make Into Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684035#M86974</link>
      <description>&lt;P&gt;I'm not sure if you can do if within just that one command, but I think you can send the Make Into Data Table message to the CrossTabBox&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
cont = dt &amp;lt;&amp;lt; Contingency(
	Y(:Age),
	X(:sex),
	Contingency Table()
);

dt_cont = Report(cont)[OutlineBox("Contingency Table"), CrossTabBox(1)] &amp;lt;&amp;lt; Make Into Data Table;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and for that you can get the reference&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 08:40:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684035#M86974</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-05T08:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script to rename a table coming from the Contingency Table option : Make Into Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684075#M86978</link>
      <description>&lt;P&gt;Hi jthi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your prompt answer. However, even if I add :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt_cont &amp;lt;&amp;lt; Data Table(Name("Contingency Table"))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I obtain the same result, the new data table is named as "Untitled XXX" (without code error).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 09:37:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684075#M86978</guid>
      <dc:creator>Arkawa</dc:creator>
      <dc:date>2023-10-05T09:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script to rename a table coming from the Contingency Table option : Make Into Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684080#M86979</link>
      <description>&lt;P&gt;The code works as follows :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt_cont &amp;lt;&amp;lt; Set Name("Contingency Table");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;:)&lt;/img&gt; Thank you !&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 09:48:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684080#M86979</guid>
      <dc:creator>Arkawa</dc:creator>
      <dc:date>2023-10-05T09:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script to rename a table coming from the Contingency Table option : Make Into Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684081#M86980</link>
      <description>&lt;P&gt;You need to use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt_cont &amp;lt;&amp;lt; set Name("Contingency Table")&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2023 09:49:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/684081#M86980</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-05T09:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Script to rename a table coming from the Contingency Table option : Make Into Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/689352#M87522</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to upgrade my code, when I generate the Contingency Analysis, now I have two analyzes one named "1" and the second "2", I would like to make the same way to obtain two data tables at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to change the code as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Contingency(
    Y( :"Pass/Fail"n ),
    X( :Task ),
    By( :X ),
);

dt_cont1 = Report("Contingency Analysis of Pass/Fail By Task X=1")[OutlineBox("Contingency Table")][CrossTabBox(1)] &amp;lt;&amp;lt; Make Into Data Table;
dt_cont1 &amp;lt;&amp;lt; Set Name("Contingency Table 1");


dt_cont2 = Report("Contingency Analysis of Pass/Fail By TaskX=2")[OutlineBox("Contingency Table")][CrossTabBox(1)] &amp;lt;&amp;lt; Make Into Data Table;
dt_cont2 &amp;lt;&amp;lt; Set Name("Contingency Table 2");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But it didn't work and I don't find the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 09:15:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/689352#M87522</guid>
      <dc:creator>Arkawa</dc:creator>
      <dc:date>2023-10-23T09:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script to rename a table coming from the Contingency Table option : Make Into Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/689354#M87524</link>
      <description>&lt;P&gt;The error message is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"object not subscriptable at row XXX in access or evaluation of 'Report("Contingency Analysis of Pass/Fail By Task X=1")[/*###*/Outline Box("Contingency Table")]',&amp;nbsp;Report("Contingency Analysis of Pass/Fail By Task X=1")[/*###*/Outline Box("Contingency Table")]&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 09:18:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/689354#M87524</guid>
      <dc:creator>Arkawa</dc:creator>
      <dc:date>2023-10-23T09:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script to rename a table coming from the Contingency Table option : Make Into Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/689359#M87525</link>
      <description>&lt;P&gt;Few different options doing this. Here is one using loop to go over different references you get from Contingency platform when using By column&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
conts = dt &amp;lt;&amp;lt; Contingency(
	Y(:height),
	X(:age),
	By(:sex)
);

Show(conts); // two references

dt_conts = {};

For Each({cont, idx}, conts,
	dt_cont = Report(cont)[OutlineBox("Contingency Table"), CrossTabBox(1)] &amp;lt;&amp;lt; Make Into Data Table;
	groupname = Word(-1, Report(cont)[OutlineBox(1)] &amp;lt;&amp;lt; get title, "=");
	dt_cont &amp;lt;&amp;lt; Set Name("Contingency Table " || groupname);
	Insert Into(dt_conts, dt_cont);
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Oct 2023 09:42:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/689359#M87525</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-23T09:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script to rename a table coming from the Contingency Table option : Make Into Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/689367#M87527</link>
      <description>&lt;P&gt;Waaaaah jthi, thank you !&lt;/P&gt;&lt;P&gt;It is very complicated ^^' but it works as well :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;Thank you so much !&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 09:50:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-rename-a-table-coming-from-the-Contingency-Table/m-p/689367#M87527</guid>
      <dc:creator>Arkawa</dc:creator>
      <dc:date>2023-10-23T09:50:54Z</dc:date>
    </item>
  </channel>
</rss>

