<?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: JSL question of tabulate, sorting, color cells in data table box in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-question-of-tabulate-sorting-color-cells-in-data-table-box/m-p/863946#M102783</link>
    <description>&lt;P&gt;Could be issue related namespaces (you are using Local)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

obj = dt &amp;lt;&amp;lt; Tabulate(
	Show Control Panel(0),
	Add Table(Column Table(Analysis Columns(:height)), Row Table(Grouping Columns(:name)))
);
dt1 = obj &amp;lt;&amp;lt; Make Into Data Table;
obj &amp;lt;&amp;lt; Close Window;

dt1 &amp;lt;&amp;lt; Sort(By(:"sum(height)"n), Replace Table, Order(Descending));

obj = dt &amp;lt;&amp;lt; Tabulate(
	Show Control Panel(0),
	Add Table(Column Table(Analysis Columns(:weight)), Row Table(Grouping Columns(:name)))
);
dt2 = obj &amp;lt;&amp;lt; Make Into Data Table;
obj &amp;lt;&amp;lt; Close Window;

dt2 &amp;lt;&amp;lt; Sort(By(:"sum(weight)"n), Replace Table, Order(Descending));

nw = New Window("summary", H List Box(Data Table Box(dt1), Data Table Box(dt2)));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 Apr 2025 13:01:17 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-04-01T13:01:17Z</dc:date>
    <item>
      <title>JSL question of tabulate, sorting, color cells in data table box</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-question-of-tabulate-sorting-color-cells-in-data-table-box/m-p/863922#M102781</link>
      <description>&lt;P&gt;Hi Community, My intention is to create multiple table via tabulate, sort the target column in each table from largest to smallest, put them together via new window, and show the first row data in green. Below is how i did it with sample data big class, with some issues I cannot figure out why:&lt;/P&gt;
&lt;P&gt;1. the sorting window keeps open and does not really perform the sorting&lt;/P&gt;
&lt;P&gt;2. the tabulate platform keeps open&lt;/P&gt;
&lt;P&gt;3.&amp;nbsp; don't know how to color cells after I put them in data table box in a new window&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is my JSL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
Open( "$SAMPLE_DATA/Big Class.jmp" );

Data Table( "Big Class.jmp" ) &amp;lt;&amp;lt; Tabulate();

Local( {obj},
	obj = Data Table( "Big Class.jmp" ) &amp;lt;&amp;lt; Tabulate(
		Show Control Panel( 0 ),
		Add Table(
			Column Table( Analysis Columns( :height ) ),
			Row Table( Grouping Columns( :name ) )
		)
	);
	dt1 = obj &amp;lt;&amp;lt; Make Into Data Table;
	obj &amp;lt;&amp;lt; Close Window;
);

dt1 &amp;lt;&amp;lt; Sort(
	By( :"sum(height)"n ),
	Replace Table,
	Order( Descending )
);

Data Table( "Big Class.jmp" ) &amp;lt;&amp;lt; Tabulate();

Local( {obj},
	obj = Data Table( "Big Class.jmp" ) &amp;lt;&amp;lt; Tabulate(
		Show Control Panel( 0 ),
		Add Table(
			Column Table( Analysis Columns( :weight ) ),
			Row Table( Grouping Columns( :name ) )
		)
	);
	dt2 = obj &amp;lt;&amp;lt; Make Into Data Table;
	obj &amp;lt;&amp;lt; Close Window;
);


dt2 &amp;lt;&amp;lt; Sort(
	By( :"sum(weight)"n ),
	Replace Table,
	Order( Descending )
);

nw = new window("summary", H list box(data table box(dt1), data table box(dt2)));

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Apr 2025 11:44:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-question-of-tabulate-sorting-color-cells-in-data-table-box/m-p/863922#M102781</guid>
      <dc:creator>Minerva</dc:creator>
      <dc:date>2025-04-01T11:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: JSL question of tabulate, sorting, color cells in data table box</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-question-of-tabulate-sorting-color-cells-in-data-table-box/m-p/863946#M102783</link>
      <description>&lt;P&gt;Could be issue related namespaces (you are using Local)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

obj = dt &amp;lt;&amp;lt; Tabulate(
	Show Control Panel(0),
	Add Table(Column Table(Analysis Columns(:height)), Row Table(Grouping Columns(:name)))
);
dt1 = obj &amp;lt;&amp;lt; Make Into Data Table;
obj &amp;lt;&amp;lt; Close Window;

dt1 &amp;lt;&amp;lt; Sort(By(:"sum(height)"n), Replace Table, Order(Descending));

obj = dt &amp;lt;&amp;lt; Tabulate(
	Show Control Panel(0),
	Add Table(Column Table(Analysis Columns(:weight)), Row Table(Grouping Columns(:name)))
);
dt2 = obj &amp;lt;&amp;lt; Make Into Data Table;
obj &amp;lt;&amp;lt; Close Window;

dt2 &amp;lt;&amp;lt; Sort(By(:"sum(weight)"n), Replace Table, Order(Descending));

nw = New Window("summary", H List Box(Data Table Box(dt1), Data Table Box(dt2)));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Apr 2025 13:01:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-question-of-tabulate-sorting-color-cells-in-data-table-box/m-p/863946#M102783</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-04-01T13:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: JSL question of tabulate, sorting, color cells in data table box</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-question-of-tabulate-sorting-color-cells-in-data-table-box/m-p/864460#M102811</link>
      <description>&lt;P&gt;thanks a lot!&lt;/P&gt;
&lt;P&gt;i tried but still got the issue of sorting platform open, not really taking action..&lt;/P&gt;
&lt;P&gt;if i run the code line by line, it works but don't know why fails when runing the entire code...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 01:49:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-question-of-tabulate-sorting-color-cells-in-data-table-box/m-p/864460#M102811</guid>
      <dc:creator>Minerva</dc:creator>
      <dc:date>2025-04-02T01:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: JSL question of tabulate, sorting, color cells in data table box</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-question-of-tabulate-sorting-color-cells-in-data-table-box/m-p/864492#M102812</link>
      <description>&lt;P&gt;Here is how I was able to get your code to work:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1743562949270.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/74472i8B06ECDB22381C92/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1743562949270.png" alt="txnelson_0-1743562949270.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

//Data Table( "Big Class.jmp" ) &amp;lt;&amp;lt; Tabulate();

//Local( {obj},
obj = Data Table( "Big Class.jmp" ) &amp;lt;&amp;lt; Tabulate(
	Show Control Panel( 0 ),
	Add Table( Column Table( Analysis Columns( :height ) ), Row Table( Grouping Columns( :name ) ) )
);
dt1 = obj &amp;lt;&amp;lt; Make Into Data Table;
obj &amp;lt;&amp;lt; Close Window;
//);

dt1 &amp;lt;&amp;lt; Sort( By( :"sum(height)"n ), Replace Table, Order( Descending ) );

// Color the cells in row 1
Current Data Table( dt1 );
:name &amp;lt;&amp;lt; color cells( "green", 1 );
:"Sum(height)"n &amp;lt;&amp;lt; color cells( "green", 1 );


//Data Table( "Big Class.jmp" ) &amp;lt;&amp;lt; Tabulate();

Local( {obj},
	obj = Data Table( "Big Class.jmp" ) &amp;lt;&amp;lt; Tabulate(
		Show Control Panel( 0 ),
		Add Table( Column Table( Analysis Columns( :weight ) ), Row Table( Grouping Columns( :name ) ) )
	);
	dt2 = obj &amp;lt;&amp;lt; Make Into Data Table;
	obj &amp;lt;&amp;lt; Close Window;
);

dt2 &amp;lt;&amp;lt; Sort( By( :"sum(weight)"n ), Replace Table, Order( Descending ) );

// Color the cells in row 1
Current Data Table( dt2 );
:name &amp;lt;&amp;lt; color cells( "green", 1 );
:"sum(weight)"n &amp;lt;&amp;lt; color cells( "green", 1 );

// The only way I know to copy cell colors in a data table to a display
// window, is to move the data table with the colored cells to a journal
// Then it can be copied into a display object in a display window.
// I repeat the operation twice in the code below
nw = New Window( "summary", hls = H List Box() );
intJr = New Window( "x", &amp;lt;&amp;lt;journal );
dt1 &amp;lt;&amp;lt; journal;
hls &amp;lt;&amp;lt; append( intJr );
intJr &amp;lt;&amp;lt; close window;
intJr = New Window( "x", &amp;lt;&amp;lt;journal );
dt2 &amp;lt;&amp;lt; journal;
hls &amp;lt;&amp;lt; append( intJr );
intJr &amp;lt;&amp;lt; close window;

Close( dt1, nosave );
Close( dt2, nosave );
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Apr 2025 03:06:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-question-of-tabulate-sorting-color-cells-in-data-table-box/m-p/864492#M102812</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-04-02T03:06:07Z</dc:date>
    </item>
  </channel>
</rss>

