BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
RyMcQeN
Community Trekker

Exclude rows from linked Summary table

Hello,

 

I have a linked summary table that I am trying to exclude rows based on some criteria of the cell contents for specific columns.  The objective is for the rows in the linked table to also become excluded.  I know it is possible to do this outside of JMP scripting but for some reason I get an error in JSL.

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dtSummary = dt << Summary( Group(:age), Link to original data table(1));
r = dtSummary << Get Rows Where(:age == 14);
r << Exclude;

 

My actual code has more complicated row selection criteria but the above example has the same idea.

 

The error returned is:

 

ERROR: Send Expects Scriptable Object in access or evaluation of 'Send' , r << Exclude;

 

I appreciate any help in advance.

 

Thx,

 

Ry

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
cwillden
Super User

Re: Exclude rows from linked Summary table

Change "Get Rows Where" to "Select Where"

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dtSummary = dt << Summary( Group(:age), Link to original data table(1));
r = dtSummary << Select Where(:age == 14);
r << Exclude;

This worked on my end.  Better yet, you can do it this way:

dtSummary << Select Where(:age == 14) << Exclude;

Get Rows Where() returns a list or the row numbers that meet the criteria.  Sending an Exclude message to a list of numbers doesn't do anything, so that's why it wasn't working.

-- Cameron Willden
2 REPLIES 2
cwillden
Super User

Re: Exclude rows from linked Summary table

Change "Get Rows Where" to "Select Where"

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dtSummary = dt << Summary( Group(:age), Link to original data table(1));
r = dtSummary << Select Where(:age == 14);
r << Exclude;

This worked on my end.  Better yet, you can do it this way:

dtSummary << Select Where(:age == 14) << Exclude;

Get Rows Where() returns a list or the row numbers that meet the criteria.  Sending an Exclude message to a list of numbers doesn't do anything, so that's why it wasn't working.

-- Cameron Willden
RyMcQeN
Community Trekker

Re: Exclude rows from linked Summary table

Thank you for the quick response. I had tried Select Where earlier but had the wrong syntax. Appreciate the help!

-Ry
0 Kudos