<?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 JSL command to group all of my excluded rows at the top of my data table? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422611#M67170</link>
    <description>&lt;P&gt;Or perhaps there's another approach using JSL?&amp;nbsp; The goal is to group all the excluded rows together as part of my validation testing procedure.&amp;nbsp; (I am training my model using un-excluded rows and testing it using excluded rows....thus the need to easily access and view the excluded rows in one place in the data table.&amp;nbsp; Otherwise they are intermixed throughout the dataset.)&amp;nbsp; I will need to repeat this step numerous times which is why I need to script it.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Sep 2021 17:16:13 GMT</pubDate>
    <dc:creator>learning_JSL</dc:creator>
    <dc:date>2021-09-30T17:16:13Z</dc:date>
    <item>
      <title>is there a JSL command to group all of my excluded rows at the top of my data table?</title>
      <link>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422576#M67166</link>
      <description>&lt;P&gt;Hi - I have not been able to find a JSL command to group all excluded rows at the top of my data table.&amp;nbsp; Is this possible?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:58:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422576#M67166</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2023-06-09T19:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: is there a JSL command to group all of my excluded rows at the top of my data table?</title>
      <link>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422584#M67168</link>
      <description>&lt;P&gt;The way I handle this is to create a matrix of the row numbers that are excluded.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
ex = dt &amp;lt;&amp;lt; get excluded rows;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you can manipulate them somewhat like a group&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 16:28:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422584#M67168</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-30T16:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: is there a JSL command to group all of my excluded rows at the top of my data table?</title>
      <link>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422611#M67170</link>
      <description>&lt;P&gt;Or perhaps there's another approach using JSL?&amp;nbsp; The goal is to group all the excluded rows together as part of my validation testing procedure.&amp;nbsp; (I am training my model using un-excluded rows and testing it using excluded rows....thus the need to easily access and view the excluded rows in one place in the data table.&amp;nbsp; Otherwise they are intermixed throughout the dataset.)&amp;nbsp; I will need to repeat this step numerous times which is why I need to script it.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 17:16:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422611#M67170</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2021-09-30T17:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: is there a JSL command to group all of my excluded rows at the top of my data table?</title>
      <link>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422616#M67171</link>
      <description>&lt;P&gt;Here is a simple extension to my first script, that reorders the rows&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
ex = dt &amp;lt;&amp;lt; get excluded rows;
dt &amp;lt;&amp;lt; New Column( "__row__", set each value( Row() ) );
dt &amp;lt;&amp;lt; New Column( "__exclude__" );
dt:__exclude__[ex] = 1;
dt &amp;lt;&amp;lt; sort( by( :__exclude__, :__row__ ), order( descending, ascending ), replace table( 1 ) );
dt &amp;lt;&amp;lt; delete columns( {"__row__", "__exclude__"} );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Sep 2021 17:32:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422616#M67171</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-09-30T17:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: is there a JSL command to group all of my excluded rows at the top of my data table?</title>
      <link>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422617#M67172</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/31342"&gt;@learning_JSL&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;see if you can make use of this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/*:

// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "/C:/Program Files/SAS/JMPPRO/14/Samples/Data/Big Class.jmp" );


// Toggle selected rows' hide and exclude states
Data Table( "Big Class" ) &amp;lt;&amp;lt; Select Randomly( Sampling Rate( 0.1 ) ) &amp;lt;&amp;lt;
Hide and Exclude;


// New column: Excluded
Data Table( "Big Class" ) &amp;lt;&amp;lt; New Column( "Excluded",
	Numeric,
	"Continuous",
	Format( "Best", 12 )
);


// Column formula: Excluded
:Excluded &amp;lt;&amp;lt; Set Formula( If( Excluded(), 1, 0 ) );


// Sort data table
Data Table( "Big Class" ) &amp;lt;&amp;lt; Sort(
	By( :Excluded ),
	Replace Table,
	Order( Descending ),
	Copy formula( 0 )
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;let us know if it worked&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 17:37:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422617#M67172</guid>
      <dc:creator>ron_horne</dc:creator>
      <dc:date>2021-09-30T17:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: is there a JSL command to group all of my excluded rows at the top of my data table?</title>
      <link>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422627#M67176</link>
      <description>&lt;P&gt;Thanks very much.&amp;nbsp; That worked perfectly.&amp;nbsp; I appreciate the help, txnelson.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 18:03:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422627#M67176</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2021-09-30T18:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: is there a JSL command to group all of my excluded rows at the top of my data table?</title>
      <link>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422644#M67178</link>
      <description>&lt;P&gt;Here is another approach.&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 );

// example
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// exclude some rows like a user might
excluded = J( 5, 1, Random Integer( 1, N Row( dt ) ) );
dt &amp;lt;&amp;lt; Select Rows( excluded ) &amp;lt;&amp;lt; Exclude( 1 ) &amp;lt;&amp;lt; Clear Select;
Wait( 2 );

// actual solution:

// select excluded rows
excluded = dt &amp;lt;&amp;lt; Get Excluded Rows;
dt &amp;lt;&amp;lt; Select Rows( excluded );

// move selected rows to top of data table
dt &amp;lt;&amp;lt; Move Rows( At Start ) &amp;lt;&amp;lt; Clear Select;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Sep 2021 18:30:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422644#M67178</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-09-30T18:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: is there a JSL command to group all of my excluded rows at the top of my data table?</title>
      <link>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422745#M67185</link>
      <description>&lt;P&gt;Thank you Mark.&amp;nbsp; Various ways to get there from here!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 22:35:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422745#M67185</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2021-09-30T22:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: is there a JSL command to group all of my excluded rows at the top of my data table?</title>
      <link>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422748#M67186</link>
      <description>&lt;P&gt;Thank you Ron.&amp;nbsp; This worked perfectly after minor massaging.&amp;nbsp; I appreciate it.&amp;nbsp; Here is what I ended up with.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open(
    "C:\Users\trcampbell\Desktop\ECOLI\share ecoli data\for Rachel\092921 MODEL\092921 n=205.jmp",
    window bounds( 217, 221, 1622, 1057 )
);
Random_rows = dt &amp;lt;&amp;lt; Select Randomly( 0.2 ) &amp;lt;&amp;lt; Hide and Exclude();
New Column( "Excluded", Numeric, "Continuous", Format( "Best", 12 ) );
:Excluded &amp;lt;&amp;lt; Set Formula( If( Excluded(), 1, 0 ) );
dt &amp;lt;&amp;lt; Sort( By( :Excluded ), Replace Table, Order( Descending ), Copy formula( 0 ) );

Close(
    dt,
    save(
        "C:\Users\trcampbell\Desktop\ECOLI\share ecoli data\for Rachel\092921 MODEL\test 10 - 092921.jmp"
    )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 15:26:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/is-there-a-JSL-command-to-group-all-of-my-excluded-rows-at-the/m-p/422748#M67186</guid>
      <dc:creator>learning_JSL</dc:creator>
      <dc:date>2021-10-11T15:26:30Z</dc:date>
    </item>
  </channel>
</rss>

