Scripting Guide > Data Tables > Advanced Data Table Scripting > Vertically Concatenate Data Tables
发布日期: 08/07/2020

Vertically Concatenate Data Tables

Concatenate, also known as a vertical join, combines rows of several data tables top to bottom.

dt << Concatenate( DataTableReferences,...,Keep Formulas,
	Output Table Name( "name" ) );

For example, if you have subsetted tables for males and females, you can put them back together using Concatenate:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( :sex == "M" );
m = dt << Subset( Output Table Name( "M" ) );
dt << Invert Row Selection;
f = dt << Subset( Output Table Name( "F" ) );
both = m << Concatenate( f, Output Table Name( "Both" ) );

Or, instead of creating a new table containing all the concatenated data, you can append all the data to the current data table:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Where( :sex == "M" );
m = dt << Subset( Output Table Name( "M" ) );
dt << Invert Row Selection;
f = dt << Subset( Output Table Name( "F" ) );
both = dt << Concatenate( m, f, "Append to First Table" );
需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).