안녕하십니까,
행 번호가 다른 두 테이블을 병합하는 방법에 대한 질문이 있습니다.
첫 번째 테이블은
2번째 테이블은
내가 원하는 최종 테이블은
대화식으로 Join 플랫폼을 실행하면 됩니다.
테이블==>조인
시간을 기준으로 일치하도록 지정합니다.
다음은 대화형 작업과 동일한 작업을 수행하는 스크립트입니다.
Names Default To Here( 1 );
// Create the first table
dt1 = New Table( "Table 1",
Add Rows( 4 ),
New Column( "Time",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [18, 18, 19, 19] )
),
New Column( "Tool",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [2, 2, 3, 3] )
)
);
// Create the second data table
dt2 = New Table( "Untitled 10",
Add Rows( 2 ),
New Column( "Time",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [18, 19] )
),
New Column( "Tool",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [5, 8] )
)
);
// Join the 2 tables
dt3 = dt1 << Join(
With( dt2 ),
Merge Same Name Columns,
By Matching Columns( :Time = :Time ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 )
);
