is there a JSL command to group all of my excluded rows at the top of my data table?Hi - I have not been able to find a JSL command to group all excluded rows at the top of my data table. Is this possible?
ScriptingRe: is there a JSL command to group all of my excluded rows at the top of my data table?The way I handle this is to create a matrix of the row numbers that are excluded.
Names Default To Here( 1 );
dt = Current Data Table();
ex = dt << get excluded rows;
Then you can manipulate them somewhat like a group
Re: is there a JSL command to group all of my excluded rows at the top of my data table?Or perhaps there's another approach using JSL? The goal is to group all the excluded rows together as part of my validation testing procedure. (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. Otherwise they are intermixed throughout the dataset.) I will need to repeat this step numerous times which is why I need to script it.
Re: is there a JSL command to group all of my excluded rows at the top of my data table?Here is a simple extension to my first script, that reorders the rows
Names Default To Here( 1 );
dt = Current Data Table();
ex = dt << get excluded rows;
dt << New Column( "__row__", set each value( Row() ) );
dt << New Column( "__exclude__" );
dt:__exclude__[ex] = 1;
dt << sort( by( :__exclude__, :__row__ ), order( descending, ascending ), replace table( 1 ) );
dt << delete columns( {"__row__", "__exclude__"} );Re: is there a JSL command to group all of my excluded rows at the top of my data table?Hi @learning_JSL
see if you can make use of this example:
/*:
// 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" ) << Select Randomly( Sampling Rate( 0.1 ) ) <<
Hide and Exclude;
// New column: Excluded
Data Table( "Big Class" ) << New Column( "Excluded",
Numeric,
"Continuous",
Format( "Best", 12 )
);
// Column formula: Excluded
:Excluded << Set Formula( If( Excluded(), 1, 0 ) );
// Sort data table
Data Table( "Big Class" ) << Sort(
By( :Excluded ),
Replace Table,
Order( Descending ),
Copy formula( 0 )
);
let us know if it worked