你好,
我尝试了连接表函数,我认为它可以一次连接一个表(例如 dt1 与 dt2 连接),我们将得到一个输出表(dtnew)。 如何使用现在的输出表(例如 dtnew)与另一个表(例如 dt3)连接。
谢谢。
JMP 版本 13 虚拟连接功能解决的主要客户驱动需求之一是内存节省足迹。 很高兴这适合您的情况。
谢谢HTH! 这也有帮助。 从来没有想过。 学习另一个新东西:)
我不确定这是否是您的意图,但如果您想要联接多个表并且您使用的是 JMP 13,则可以转到表下拉列表并选择 JMP 查询生成器。从那里您可以一次连接最多 60 个表,而不必编写连接脚本。
华泰
这是为每个连接创建单独的表的一种方法。
Names Default To Here( 1 );
// Create the original table
dtBase = New Table( "Base Table",
Add Rows( 10 ),
New Column( "name",
character,
Set Values( {"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT", "BARBARA", "ALICE"} )
),
New Column( "age", Set Values( [12, 12, 12, 12, 12, 12, 12, 12, 13, 13] ) ),
New Column( "sex", character, Set Values( {"F", "F", "F", "F", "F", "M", "M", "M", "F", "F"} ) )
);
// Create a second table
dt2 = New Table( "Height",
Add Rows( 10 ),
New Column( "name",
character,
Set Values( {"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT", "BARBARA", "ALICE"} )
),
New Column( "height", Set Values( [59, 61, 55, 66, 52, 60, 61, 51, 60, 61] ) ),
Set Label Columns( :name )
);
// Join the two tables and create a reference to the new table
dtjoined = dtBase << Join(
With( dt2 ),
By Matching Columns( :name = :name ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 ),
Merge same name columns( 1 ),
Match Flag( 0 )
);
// Close the nolonger needed tables and set the base table reference to the new table
Close( dtBase, nosave );
Close( dt2, nosave );
dtBase = dtjoined;
// Create another table to be joined
dt3 = New Table( "Weight",
Add Rows( 10 ),
New Column( "name",
character,
Set Values( {"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT", "BARBARA", "ALICE"} )
),
New Column( "weight", Set Values( [95, 123, 74, 145, 64, 84, 128, 79, 112, 107] ) ),
Set Label Columns( :name )
);
// Join the new table
dtjoined = dtBase << Join(
With( dt3 ),
By Matching Columns( :name = :name ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 ),
Merge same name columns( 1 ),
Match Flag( 0 )
);
// Close the nolonger needed tables and set the base table reference to the new table
Close( dtBase, nosave );
Close( dt3, nosave );
dtBase = dtjoined;