<?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: Is there a way to create a report for 2 column switcher simultaneously ? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761901#M94003</link>
    <description>&lt;P&gt;I fixed my problem with the following script, but when I run it on the full database, JMP crashes (memory issue I assume), any idea how I could go around the memory issue ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oneway(&lt;BR /&gt;Y( :Name( "A" ) ),&lt;BR /&gt;X( :Name( "1" ) ),&lt;BR /&gt;t Test( 1 ),&lt;BR /&gt;Column Switcher( :Name( "1" ), {:Name( "1" ), :Name( "2" ), :Name( "3" )} ),&lt;BR /&gt;Column Switcher(&lt;BR /&gt;:Name( "A" ),&lt;BR /&gt;{:Name( "A" ), :Name( "B" ), :Name( "C" )}&lt;BR /&gt;)&lt;BR /&gt;);&lt;BR /&gt;rpt = Current Report();&lt;BR /&gt;colswitcher_obj = rpt[ColumnSwitcherCOntextOutlinebox( 1 )] &amp;lt;&amp;lt; get scriptable object;&lt;BR /&gt;colswitcher_obj2 = rpt[ColumnSwitcherCOntextOutlinebox( 2 )] &amp;lt;&amp;lt; get scriptable object;&lt;BR /&gt;colswitch_list = colswitcher_obj &amp;lt;&amp;lt; get list;&lt;/P&gt;&lt;P&gt;// Loop through each Y variable&lt;BR /&gt;For(j = 1, j &amp;lt;= N Items(colswitch_list), j++,&lt;/P&gt;&lt;P&gt;// Loop through each X variable&lt;BR /&gt;For(k = 1, k &amp;lt;= N Items(colswitch_list), k++,&lt;/P&gt;&lt;P&gt;/* Change here */&lt;BR /&gt;dt1 = rpt[Outline Box( "t Test" )][Table Box( 1 )] &amp;lt;&amp;lt; Make Combined Data Table;&lt;/P&gt;&lt;P&gt;/* Concatenate the tables */&lt;BR /&gt;If(j == 1 &amp;amp; k == 1,&lt;BR /&gt;main_tb = dt1;&lt;BR /&gt;main_tb &amp;lt;&amp;lt; Set Name( "All" );&lt;BR /&gt;,&lt;BR /&gt;Try( main_tb &amp;lt;&amp;lt; Concatenate( dt1, Append to First Table ) );&lt;BR /&gt;Close( dt1, No Save );&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;// Switch to next X column&lt;BR /&gt;colSwitcher_obj &amp;lt;&amp;lt; Next;&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;// Switch to next Y column&lt;BR /&gt;colSwitcher_obj2 &amp;lt;&amp;lt; Next;&lt;BR /&gt;);&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2024 18:38:26 GMT</pubDate>
    <dc:creator>GCardin</dc:creator>
    <dc:date>2024-05-28T18:38:26Z</dc:date>
    <item>
      <title>Is there a way to create a report for 2 column switcher simultaneously ?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761888#M93996</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I wanted to run multiple t-test where I have a list of multiple X and Ys. Is there a way to do this using a script ? I modified slightly the script I am using for 1 column switcher but I can't figure out how to do them both at the same time. For exemple this smaller test (3x3):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Oneway(
	Y(:Name("A")),
	X(:Name("1")),
	t Test(1),
	Column Switcher(:Name("A"), {:Name("A"), :Name("B"), :Name("C")}),
	Column Switcher(:Name("1"), {:Name("1"), :Name("2"), :Name("3")})
);

rpt = Current Report();
colswitcher_obj = rpt[ColumnSwitcherCOntextOutlinebox(1)] &amp;lt;&amp;lt; get scriptable object;
colswitch_list = colswitcher_obj &amp;lt;&amp;lt; get list;

/* Loop through each column in the colswitch_list */
For(i = 1, i &amp;lt;= N Items(colswitch_list), i++, 

/* Change here */
	dt1 = rpt[Outline Box("t Test")][Table Box(1)] &amp;lt;&amp;lt; make combined data table;

/* Concatenate the tables */
	If(i == 1,
		main_tb = dt1;
		main_tb &amp;lt;&amp;lt; Set Name("All");
	,
		Try(main_tb &amp;lt;&amp;lt; Concatenate(dt1, Append to First Table));
		Close(dt1, No Save);
	);

/* Close temporary tables and switch next column */
	colSwitcher_obj &amp;lt;&amp;lt; Next;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 18:08:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761888#M93996</guid>
      <dc:creator>GCardin</dc:creator>
      <dc:date>2024-05-28T18:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to create a report for 2 column switcher simultaneously ?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761891#M93999</link>
      <description>&lt;P&gt;Is there a specific reason to use column switcher for this? You could just loop over your columns, re-create report as you go and extract results.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 18:20:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761891#M93999</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-05-28T18:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to create a report for 2 column switcher simultaneously ?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761901#M94003</link>
      <description>&lt;P&gt;I fixed my problem with the following script, but when I run it on the full database, JMP crashes (memory issue I assume), any idea how I could go around the memory issue ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Oneway(&lt;BR /&gt;Y( :Name( "A" ) ),&lt;BR /&gt;X( :Name( "1" ) ),&lt;BR /&gt;t Test( 1 ),&lt;BR /&gt;Column Switcher( :Name( "1" ), {:Name( "1" ), :Name( "2" ), :Name( "3" )} ),&lt;BR /&gt;Column Switcher(&lt;BR /&gt;:Name( "A" ),&lt;BR /&gt;{:Name( "A" ), :Name( "B" ), :Name( "C" )}&lt;BR /&gt;)&lt;BR /&gt;);&lt;BR /&gt;rpt = Current Report();&lt;BR /&gt;colswitcher_obj = rpt[ColumnSwitcherCOntextOutlinebox( 1 )] &amp;lt;&amp;lt; get scriptable object;&lt;BR /&gt;colswitcher_obj2 = rpt[ColumnSwitcherCOntextOutlinebox( 2 )] &amp;lt;&amp;lt; get scriptable object;&lt;BR /&gt;colswitch_list = colswitcher_obj &amp;lt;&amp;lt; get list;&lt;/P&gt;&lt;P&gt;// Loop through each Y variable&lt;BR /&gt;For(j = 1, j &amp;lt;= N Items(colswitch_list), j++,&lt;/P&gt;&lt;P&gt;// Loop through each X variable&lt;BR /&gt;For(k = 1, k &amp;lt;= N Items(colswitch_list), k++,&lt;/P&gt;&lt;P&gt;/* Change here */&lt;BR /&gt;dt1 = rpt[Outline Box( "t Test" )][Table Box( 1 )] &amp;lt;&amp;lt; Make Combined Data Table;&lt;/P&gt;&lt;P&gt;/* Concatenate the tables */&lt;BR /&gt;If(j == 1 &amp;amp; k == 1,&lt;BR /&gt;main_tb = dt1;&lt;BR /&gt;main_tb &amp;lt;&amp;lt; Set Name( "All" );&lt;BR /&gt;,&lt;BR /&gt;Try( main_tb &amp;lt;&amp;lt; Concatenate( dt1, Append to First Table ) );&lt;BR /&gt;Close( dt1, No Save );&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;// Switch to next X column&lt;BR /&gt;colSwitcher_obj &amp;lt;&amp;lt; Next;&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;// Switch to next Y column&lt;BR /&gt;colSwitcher_obj2 &amp;lt;&amp;lt; Next;&lt;BR /&gt;);&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 18:38:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761901#M94003</guid>
      <dc:creator>GCardin</dc:creator>
      <dc:date>2024-05-28T18:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to create a report for 2 column switcher simultaneously ?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761902#M94004</link>
      <description>&lt;P&gt;Difficult to say without knowing anything about your data. You could for example run into issue where one of your columns has massive amounts of categories and that is causing issues. Maybe adding wait(0); after each &amp;lt;&amp;lt; next could help it a little, but the script will still be most likely very slow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I think you are using incorrect max count for your k variable at least (shouldn't it be N Items(col_switch_list2)).&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 19:04:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761902#M94004</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-05-28T19:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to create a report for 2 column switcher simultaneously ?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761972#M94012</link>
      <description>&lt;P&gt;Indeed you are right, now it works perfectly for a 10x10 of columns (see script below).&lt;/P&gt;&lt;P&gt;But I have an issue that if I don't have exactly the same number of X columns than of Y columns, the switching doesn't work ! Any idea please what I am doing wrong ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Analysis and column switchers&lt;BR /&gt;Oneway(&lt;BR /&gt;Y(:Name("553")),&lt;BR /&gt;X(:Name("1")),&lt;BR /&gt;t Test(1),&lt;BR /&gt;Column Switcher(:Name("1"), {:Name("1"), :Name("2"), :Name("3"), :Name("4"), :Name("5"), :Name("6"), :Name("7"), :Name("8"), :Name("9"), :Name("10")}),&lt;BR /&gt;Column Switcher(:Name("553"), {:Name("553"), :Name("554"), :Name("555"), :Name("556"), :Name("557"), :Name("558"), :Name("559"), :Name("560"), :Name("561"), :Name("562")}));&lt;/P&gt;&lt;P&gt;//Report creation&lt;BR /&gt;rpt = Current Report();&lt;BR /&gt;colswitcher_obj = rpt[ColumnSwitcherCOntextOutlinebox( 1 )] &amp;lt;&amp;lt; get scriptable object;&lt;BR /&gt;colswitcher_obj2 = rpt[ColumnSwitcherCOntextOutlinebox( 2 )] &amp;lt;&amp;lt; get scriptable object;&lt;BR /&gt;colswitch_list = colswitcher_obj &amp;lt;&amp;lt; get list;&lt;BR /&gt;colswitch_list2 = colswitcher_obj2 &amp;lt;&amp;lt; get list;&lt;/P&gt;&lt;P&gt;// Loop through each Y variable&lt;BR /&gt;For(j = 1, j &amp;lt;= N Items(colswitch_list), j++,&lt;/P&gt;&lt;P&gt;// Loop through each X variable&lt;BR /&gt;For(k = 1, k &amp;lt;= N Items(colswitch_list2), k++,&lt;/P&gt;&lt;P&gt;/* Change here */&lt;BR /&gt;dt1 = rpt[Outline Box( "t Test" )][Table Box( 1 )] &amp;lt;&amp;lt; Make Combined Data Table;&lt;/P&gt;&lt;P&gt;/* Concatenate the tables */&lt;BR /&gt;If(j == 1 &amp;amp; k == 1,&lt;BR /&gt;main_tb = dt1;&lt;BR /&gt;main_tb &amp;lt;&amp;lt; Set Name( "All" );&lt;BR /&gt;,&lt;BR /&gt;Try( main_tb &amp;lt;&amp;lt; Concatenate( dt1, Append to First Table ) );&lt;BR /&gt;Close( dt1, No Save );&lt;BR /&gt;);&lt;/P&gt;&lt;P&gt;// Switch to next X column&lt;BR /&gt;colSwitcher_obj &amp;lt;&amp;lt; Next;&lt;BR /&gt;wait(0);&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;// Switch to next Y column&lt;BR /&gt;colSwitcher_obj2 &amp;lt;&amp;lt; Next;&lt;BR /&gt;wait(0);&lt;BR /&gt;);&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 14:01:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761972#M94012</guid>
      <dc:creator>GCardin</dc:creator>
      <dc:date>2024-05-29T14:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to create a report for 2 column switcher simultaneously ?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761978#M94013</link>
      <description>&lt;P&gt;You are using wrong column switcher object references inside your loops (inner loop which has N Items(colswitch_list2) should change colSwitcher_obj2 &amp;lt;&amp;lt; Next).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1716992154852.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64620i7ABA60829621258F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1716992154852.png" alt="jthi_1-1716992154852.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Also use &lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1716992111616.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/64619i9258F59119BE4E64/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1716992111616.png" alt="jthi_0-1716992111616.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;when posting JSL to JMP Community as it makes reading the post much easier.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 14:16:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-create-a-report-for-2-column-switcher/m-p/761978#M94013</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-05-29T14:16:03Z</dc:date>
    </item>
  </channel>
</rss>

