- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Concatenate data table from subset
Hi all,
I have to subset a data table and concatenate the data tables one by one into another file.
How can I concatenate the data tables from the subset table to the original table? please help, im really not sure how to do it
Here's my sample data:
Data Table( "Analgesics" ) << Subset(
Output Table( "dt_subset" ),
By( :gender ),
All rows,
Selected columns only( 0 ),
columns( :drug, :pain )
);
// concatenating to my original data table
For( i = 1, i <= 10, i++, //not sure on this one
dt << concatenate( dt_subset( i ), Append to First Table( 1 ) )
);
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Concatenate data table from subset
Get reference of the subset and then use that for looping.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Analgesics.jmp");
dt_subset = dt << Subset(
Output Table("Subset_of_analgesics"),
By(:gender),
All rows,
Selected columns only(0),
columns(:drug, :pain)
);
Show(dt_subset);
//dt_subset is a list, use N items to get items in the list
For(i = 1, i <= N Items(dt_subset), i++,
dt << Concatenate(dt_subset[i], Append To first table(1));
);
-Jarmo
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Concatenate data table from subset
Get reference of the subset and then use that for looping.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Analgesics.jmp");
dt_subset = dt << Subset(
Output Table("Subset_of_analgesics"),
By(:gender),
All rows,
Selected columns only(0),
columns(:drug, :pain)
);
Show(dt_subset);
//dt_subset is a list, use N items to get items in the list
For(i = 1, i <= N Items(dt_subset), i++,
dt << Concatenate(dt_subset[i], Append To first table(1));
);
-Jarmo