cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
ms
Super User (Alumni) ms
Super User (Alumni)

Number of selected rows

In the lower left pane of a JMP data table there is a list with row information, including the number of currently selected cells.

Is there a JSL command that can retrieve that information directly? I can of course loop through all rows and count all selected cells. However, it may be more efficient to grab a number that JMP already seem to have calculated automatically.

I am asking because I am running a script that conditionally selects different sets of rows in a huge table and want a fast way to neglect sets with too few rows.
1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Number of selected rows

num_selected = nrows(dt << get selected rows);

View solution in original post

4 REPLIES 4
pmroz
Super User

Re: Number of selected rows

num_selected = nrows(dt << get selected rows);
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Number of selected rows

Thanks! Just what I was looking for. Simple and elegant.
robust1972
Level IV

Re: Number of selected rows

hi, PMroz

I am trying to select certain rows in a table with a criteria and then delete them if the number of selected rows is greater than 0 as below but got the error as inserted pic.

if( (nrows(dtlist8<< get selected rows()))>0,

dtlist8 <<delete rows,

);

11365_pastedImage_0.png

pmroz
Super User

Re: Number of selected rows

What is dtlist8 pointing to?  It seems like it isn't pointing to a table.  The following code works:

 

 

dtlist8 = open("$sample_data\Big Class.jmp");
if( nrows(dtlist8 << get selected rows()) > 0,
      dtlist8 << delete rows,
);