Subscribe Bookmark RSS Feed

How to write a jsl to selected only on specific rows which are intend to hide and exclude?

bernie426

Community Trekker

Joined:

Feb 9, 2015

I would like to select only on specific rows, and willing to hide and exclude those raws/OR having a subset table coming out from it.

The Raws that I like to selected is from a Character Column. Let's say having a Character column called Tasty,and having different level like Sweet, Sour, Hot, Spicy, Taste 1.0, Taste 2.0, Taste 3.0,  Taste 4.0, Taste 5.0, Bad, Worse, Worst. Then I would only like to select on the Sweet, Sour, Hot, Spicy Rows, then make one subset table out from it, and have another subset table that hide and exclude Sweet, Sour, Hot, Spicy rows, and keep the rest Rows.

Hence, 2 subset table would like create from their mother data table.

Could anyone help me out with this using a jmp script?

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

The Select Where() and Get Rows Where() messages would be very useful here.

Example:

dt = Current Data Table();

my_list = {"Sweet", "Sour", "Hot", "Spicy"};

dtsub1 = dt << subset(

    rows( dt << get rows where( Contains( my_list, :Tasty ) ) ),

    Selected columns only( 0 )

);

dtsub2 = dt << subset( All rows, Selected columns only( 0 ) );

dtsub2 << select  where( Contains( my_list, :Tasty ) ) << exclude << hide;

3 REPLIES
Solution

The Select Where() and Get Rows Where() messages would be very useful here.

Example:

dt = Current Data Table();

my_list = {"Sweet", "Sour", "Hot", "Spicy"};

dtsub1 = dt << subset(

    rows( dt << get rows where( Contains( my_list, :Tasty ) ) ),

    Selected columns only( 0 )

);

dtsub2 = dt << subset( All rows, Selected columns only( 0 ) );

dtsub2 << select  where( Contains( my_list, :Tasty ) ) << exclude << hide;

bernie426

Community Trekker

Joined:

Feb 9, 2015

Thanks, MS.

What does the Selected columns only( 0 ) means here?

pmroz

Super User

Joined:

Jun 23, 2011

It means to create a subset using all of the columns of the original dataset.  If the 0 were changed to a 1 then it would create a subset using columns that had been selected in the original dataset.