cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

Subset By and accessing the :col values used in the subset

Hello,

 

When subset by is performed, the Table Panel will show the :cols and their values for the given subset data table.

How does user access this information using script command?

 

Example:

 

mysubdt = mymaindt << Subset (by ( :first_var, :sec_var, :third_var));  // each var has multiple levels, aka several values. 
// then mysubdt[1] through mysubdt[n] with n being the number of subset data tables created.

 

 

For each mysubdt[i], the Panel would show for example for one of the subset data tables:

first_var      abc

sec_var      xyz

third_var     123

 

The objective here is to then save each mysubdt[i] by doing a save that uses these variables' values.

mysubdt[1] << save ("dt_abc_xyz_123.jmp");

 

Just can't seem yet to find this table property information.

Other approaches?

 

Thanks,

John

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Subset By and accessing the :col values used in the subset

Try

mysubdtt[1] << save ("$mypath\" || filename || ".jmp");
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: Subset By and accessing the :col values used in the subset

x=dt<<get table variable("first_var")
Jim
johnm
Level III

Re: Subset By and accessing the :col values used in the subset

Hi Jim,

 

Thanks for quick reply!

 

I subsequently create a string and filename variable:

fld1 = mysubdtt[1] << get table variable ("first_var");
fld2 = mysubdtt[1] << get table variable ("sec_var");
fld3 = mysubdtt[1] << get table variable ("third_var");

filename = "dt_"||(fld1)||"_"||(fld2)||"_"||(fld3);

 

in an attempt to then save as follows:

mysubdtt[1] << save ("$mypath\$filename.jmp"); 

 

but not quite working as the file saved to the mypath is "$filename.jmp".

 

John

 

txnelson
Super User

Re: Subset By and accessing the :col values used in the subset

Try

mysubdtt[1] << save ("$mypath\" || filename || ".jmp");
Jim
johnm
Level III

Re: Subset By and accessing the :col values used in the subset

Thanks again Jim!

Recommended Articles