使用相對引用連接表你好;
我正在嘗試連接兩個表,但是,我想要列的引用,而不是列名。 我嘗試用列(5)替換:Name(“...”),例如,它不起作用。 我也嘗試過分配Col5 = Column(5)然後在腳本中使用Col5,但這也不起作用。
我試過搜索,似乎找不到任何有幫助的東西。 謝謝!
Data Table( "IO Data Table" ) << Join(
With( Data Table( "EA$" ) ),
Select(
:Plant,
:Material,
:INV,
:Past Due,
:Name( "Sum(QTY, 10/31/2018)" ),
:Name( "Sum(QTY, 11/01/2018)" ),
:Name( "Sum(QTY, 11/02/2018)" ),
:Name( "Sum(QTY, 11/05/2018)" ),
:Name( "Sum(QTY, 11/06/2018)" ),
:Name( "Sum(QTY, 11/07/2018)" )
),
SelectWith( :EA$ ),
By Matching Columns( :Plant = :Plant, :Material = :Finished Good ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 ),
Output Table( "Backlog Pivot" )
)
Re:使用相對引用連接表謝謝你的回應,吉姆。 當我閱讀你的例子時,我意識到我忘記了代碼中的某些內容,現在它可以正常工作了。
Col5 = Column( CONCTable, 5 );
Col6 = Column( CONCTable, 6 );
Col7 = Column( CONCTable, 7 );
Col8 = Column( CONCTable, 8 );
Col9 = Column( CONCTable, 9 );
Col10 = Column( CONCTable, 10 );
IO2 = Data Table( "IO Data Table" ) << Join(
With( Data Table( "EA$" ) ),
Select(
:Plant,
:Material,
:INV,
:Past Due,
Col5,
Col6,
Col7,
Col8,
Col9,
Col10
),
SelectWith( :EA$ ),
By Matching Columns( :Plant = :Plant, :Material = :Finished Good ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 ),
Output Table( "Backlog Pivot" )
);
Re:使用相對引用連接表如果我理解您的問題,下面是一個腳本,它使用幾種不同類型的相對引用來生成連接表。
Names Default To Here( 1 );
dt1 = Open( "$SAMPLE_DATA\big class.jmp" );
dt2 = Open( "$SAMPLE_DATA\big class families.jmp" );
namecol = Column( dt1, "Name" );
i = 3;
Data Table( "Big Class" ) << Join(
With( Data Table( "big class families" ) ),
Merge Same Name Columns,
Match Flag( 0 ),
Select( :sex, :height, :weight ),
SelectWith( :sibling ages ),
By Matching Columns( namecol = :name, :age = Column( dt2, i ) ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 )
);