Worked. Many thanks. Now I just have to figure out how to copy the non-matching columns but I think I can manage.
@RonB wrote:
Now I just have to figure out how to copy the non-matching columns but I think I can manage.
Non-matching columns from which table? The example above keeps all the columns from the Fitness table and concatenates only the columns that have the same name from Big Class. It does this by only subsetting Big Class to get the columns with the same names and then concatenating that to Fitness (which still has all of its columns). There shouldn't be any work to keep the non-matching columns.
@RonB wrote:
Yes, I understand that. But the data structure I'm dealing with requires to copy also columns in Big Class that do not have the same name in Fitness. I.e., these columns will be "vertically concatenated" to the output table as new columns. These columns will begin with missing data (as many rows as are in Fitness) followed by the data from Big Class.
How is this different from simply concatenating the two tables together to begin with? Doing that you'll end up with a table with all the rows and all the columns from both tables. The columns that don't have matching names in both tables will be empty for the rows that didn't have those columns originally.
Let's stop talking abstractly and be more concrete. Here are two tables:
Table1
A | B | C |
1 | 1 | 1 |
2 | 2 | 2 |
3 | 3 | 3 |
Table2
A | B | D |
4 | 4 | 4 |
5 | 5 | 5 |
6 | 6 |
6 |
Using Tables->Concatenate on these two tables, you'll end up with this table.
Table3
A | B | C | D |
1 | 1 |
1 |
• |
2 | 2 | 2 | • |
3 | 3 | 3 | • |
4 | 4 | • | 4 |
5 | 5 | • | 5 |
6 | 6 | • | 6 |
The way I interpret your description above makes me think that's the table you want. If it's not, I'm sorry I've misunderstood your requirement.