Subscribe Bookmark RSS Feed

Number of selected rows

ms

Super User

Joined:

Jun 23, 2011

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

Joined:

Jun 23, 2011

Solution
num_selected = nrows(dt << get selected rows);
4 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

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

Super User

Joined:

Jun 23, 2011

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

Community Trekker

Joined:

Jan 15, 2014

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

Joined:

Jun 23, 2011

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,

);