cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to see how to import and prepare Excel data on Jan. 30 from 2 to 3 p.m. ET.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

How to retitle a subset data table based on the data filter selections used to create it

Using code I found in this post discussion (Solved: How to get data selected by Data Filter () into a new data table (using JSL)? - JMP User Co...https://community.jmp.com/t5/Discussions/How-to-get-data-selected-by-Data-Filter-into-a-new-data-tab...), I am able to choose specific age and sex combinations via the data filter and generate a subset table titled "Subset of Big Class" that contains only those desired rows. However, I would like to use the options checked in the data filter to title or rename the data file. For example, if I check age 13 and sex female, I would like to automatically name/title the table "Age 13 Sex F Subset of Big Class" or something similar. Unfortunately, I cannot figure out how to grab those values from the Data Filter or in the script.

Could someone please point me towards the right function, option, or syntax? 

I could extract them from the resulting data itself I suppose, but I have to believe that there is a way to store those values "at the source".

JMP 17

Thank you!

 

 

 

3 REPLIES 3
jthi
Super User

Re: How to retitle a subset data table based on the data filter selections used to create it

Without really knowing how you wish the name to look like, I would maybe first look into << Get Where Clause which you can send to the data filter and it would give you something like

jthi_0-1769544692328.png

"Select Where((:age == 12 | :age == 14) & (:sex == \!"F\!" | :sex == \!"M\!"))"

You can then extract 

(:age == 12 | :age == 14) & (:sex == \!"F\!" | :sex == \!"M\!")

and use that as the name

-Jarmo

Re: How to retitle a subset data table based on the data filter selections used to create it

Thank you for the suggestion Jarmo. I have used "Select where" in other scripts. Unfortunately, I need the interactive aspect of the Data Filter because it will be different every time it is run. I cannot hard code specific options as suggested - unless I'm misunderstanding your idea? 

As for the name, I can accommodate any format as long as the desired info is in there. I'm not concerned with making the name once I can get the age(s) and sex(es) selected into some variable or object that I can manipulate. 

jthi
Super User

Re: How to retitle a subset data table based on the data filter selections used to create it

Format which you get with << Get Where Clause is one option. Optionally you can extract the values from the resulting table based on the columns used in the filter (you can do it from the original table, but it is easier and most likely faster to do it from result table).

-Jarmo

Recommended Articles