Subscribe Bookmark RSS Feed

Way to script to exclude all rows except certain ones

rebecca-maceach

Community Trekker

Joined:

Mar 5, 2015

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
Solution

You need parentheses after current data table:

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

4 REPLIES
ms

Super User

Joined:

Jun 23, 2011

For rows this syntax can be used:

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

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

rebecca-maceach

Community Trekker

Joined:

Mar 5, 2015

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?

Solution

You need parentheses after current data table:

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

syl022

Community Trekker

Joined:

Jan 6, 2015

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.