cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar

Way to script to exclude all rows except certain ones

I know that there is a long hand way to do this:

Row State( 3 ) = Excluded State( 0 );

Excluded( Row State( 3 ) );

Row State( 1 ) = Excluded State( 1 );

Excluded( Row State( 1 ) );

Row State( 5 ) = Excluded State( 1 );

Excluded( Row State( 5 ) );

Row State( 6 ) = Excluded State( 0 );

Excluded( Row State( 6 ) );

Row State( 7 ) = Excluded State( 1 );

Excluded( Row State( 7 ) );

Row State( 8 ) = Excluded State( 1 );

Excluded( Row State( 8 ) );

But I am guessing that there may be a quicker way to exclude columns when dealing with a lot of columns.

I want the script to basically say, "exclude all columns except columns 5 and 7" (or whatever columns the case may be)

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: Way to script to exclude all rows except certain ones

You need parentheses after current data table:

Current Data Table() << select rows([5, 7]) << invert row selection << exclude;

View solution in original post

4 REPLIES 4
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Way to script to exclude all rows except certain ones

For rows this syntax can be used:

dt = Open("$sample_data\Big Class.jmp");

dt << select rows([5, 7]) << invert row selection << exclude;

Re: Way to script to exclude all rows except certain ones

If I want that to happen in the current data table I'm working with, I used this syntax:

Current Data Table <<select rows([5, 7]) <<invert row selection << exclude;

but it did not work. Nothing happened at all when I ran it. Am I missing something?

pmroz
Super User

Re: Way to script to exclude all rows except certain ones

You need parentheses after current data table:

Current Data Table() << select rows([5, 7]) << invert row selection << exclude;

syl022
Level I

Re: Way to script to exclude all rows except certain ones

One thing that you can do is using "Stack" under Tables.

You can stack all the columns, and JMP will return a data table with only two columns (label and data). The label column will have all the columns listed in the previous data table.

Then, you can right click the column to select "Data Filter." Then, select and exclude all the columns listed in Label Column that you are not interested in.

After that, you can change the data table to the original data table by using "Split" under Tables. In Split, you should split Data Column by Label Column.