Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
bernie426
Level II

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

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
Highlighted
ms
Super User ms
Super User

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

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;

View solution in original post

4 REPLIES 4
Highlighted
ms
Super User ms
Super User

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

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;

View solution in original post

Highlighted
bernie426
Level II

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

Thanks, MS.

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

Highlighted
pmroz
Super User

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

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.

Highlighted
Stas
Level I

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

And if instead of using my_list={strings}, I need to search and select by variable content (For example, variable named beverages that by users input can be any of the characters "Sweet", "Sour", "Hot", "Spicy"). How could I then create the same subset?

Article Labels

    There are no labels assigned to this post.