- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Subset By and accessing the :col values used in the subset
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Subset By and accessing the :col values used in the subset
x=dt<<get table variable("first_var")
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Subset By and accessing the :col values used in the subset
Created:
Jul 25, 2022 12:54 PM
| Last Modified: Jul 25, 2022 10:04 AM
(1244 views)
| Posted in reply to message from txnelson 07-25-2022
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Subset By and accessing the :col values used in the subset
Try
mysubdtt[1] << save ("$mypath\" || filename || ".jmp");
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Subset By and accessing the :col values used in the subset
Thanks again Jim!