- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
column selection/data subset
Need a little help. In my data table i have like 500 columns and 2000 rows. I have another data table which contains only a small ## of column names (subset of columns of the original table). How do i subset my my original data table so it contains only the columns which are i have a list for in the second table.?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: column selection/data subset
Just a comment about stacking. By stacking and splitting(un stacking) the column metadata is lost, where using either of the techniques that Jarmo suggested does not. Formats, formulas, Column Properties such as Units, Value Labels, Spec Limits, Control Limits will be lost.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: column selection/data subset
I think this interactive flow should work:
I have two tables, this small table determines the columns I wish to keep
My other table has much more data but I need to just get those columns
you can use Join to basically overwrite the values is smaller table
With pure script solution it could look something like this. First get the column names from the smaller table into a list using << Get Column Names("String") and then use that list in << Subset()
Names Default To Here(1);
dtbig = Open("$SAMPLE_DATA/Big Class Families.jmp");
dtsmall = Open("$SAMPLE_DATA/Big Class.jmp");
cols_to_keep = dtsmall << Get Column Names("String");
dt_new = dtbig << Subset(All Rows, Columns(cols_to_keep));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: column selection/data subset
Thanks...i think stacking and un stacking does it for me...Appreciate your help..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: column selection/data subset
Just a comment about stacking. By stacking and splitting(un stacking) the column metadata is lost, where using either of the techniques that Jarmo suggested does not. Formats, formulas, Column Properties such as Units, Value Labels, Spec Limits, Control Limits will be lost.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content