dt1のすべての行に加えて、dt1の「Id」列と一致しないdt2行を含むdt3を作成する方法は、dt1とdt2のいくつかの列のみを表示します。結果を取得したい:dt1とdt2を比較し、「Id」が一致しない場合は、dt1のすべての行で新しいテーブルdt3を作成し、dt2の一致しない行をdt1に追加して、3を選択します。列(名前、ロット、EPval)がdt3に表示されます。どうもありがとう
dt1 = New Table( "test",
addrows( 3 ),
New Column( "lot", character, values( {"K1", "K2", "K3"} ) ),
New Column( "Id", numeric, values( {"11889922", "11776620", "22889955"} ) ),
New Column( "EPval", numeric, values( {1, 2, .} ) ),
New Column( "Name", character, values( {"John", "Joe", "PP"} ) )
);
dt2 = New Table( "test",
addrows( 3 ),
New Column( "lot", character, values( {"K1", "K2", "K3"} ) ),
New Column( "Id", numeric, values( {"33888822", "11776620", "22889955"} ) ),
New Column( "EPval", numeric, values( {1, 2, .} ) ),
New Column( "Mgr", character, values( {"J", "H", "P"} ) )
);データ表Re:dt1のすべての行と、dt1の「Id」列と一致しないdt2の行でdt3を作成する方法は、dt1とdt2のいくつかの列しか表示しないお返事をありがとうございます。しかし、スクリプトを実行しますか?私のPCでは動作しません。私はJMP14を使用していますが、これが原因かどうかはわかりません。dt3がポップアップしない
Re:dt1のすべての行と、dt1の「Id」列と一致しないdt2の行でdt3を作成する方法は、dt1とdt2のいくつかの列しか表示しないどうやら、私は誤ってマージの "With"要素を削除しました。 私がそれをどのようにしたかわからない.....しかし....これは修正されたコードです
/*I Want to get the result of: compare dt1 with dt2, if there are "Id" don't match then create a new table dt3 with dt1 all rows, and add the don't match rows in dt2 into dt1, and pick 3 columns(name, lot, EPval) show out in dt3. thanks a lot */
dt1 = New Table( "test",
addrows( 3 ),
New Column( "lot", character, values( {"K1", "K2", "K3"} ) ),
New Column( "Id", numeric, values( {"11889922", "11776620", "22889955"} ) ),
New Column( "EPval", numeric, values( {1, 2, .} ) ),
New Column( "Name", character, values( {"John", "Joe", "PP"} ) )
);
dt2 = New Table( "test",
addrows( 3 ),
New Column( "lot", character, values( {"K1", "K2", "K3"} ) ),
New Column( "Id", numeric, values( {"33888822", "11776620", "22889955"} ) ),
New Column( "EPval", numeric, values( {1, 2, .} ) ),
New Column( "Mgr", character, values( {"J", "H", "P"} ) )
);
// I assumed that there
dt3 = dt1 << Join( with(dt2),
By Matching Columns( :Id = :Id ),
Drop multiples( 0, 0 ),
Include Nonmatches( 1, 1 ),
Preserve main table order( 1 )
);
Re:dt1のすべての行と、dt1の「Id」列と一致しないdt2の行でdt3を作成する方法は、dt1とdt2のいくつかの列しか表示しない
これはまだ機能しないログです。私はこの質問をするために別の例を投稿するかもしれません。2番目の例が機能する場合、この例は無視できます。
//:* /
dt3 = dt1 << Join(
列を一致させることにより(:Id =:Id)、
複数をドロップ(0、0)、
不一致を含める(1、1)、
メインテーブルの順序を保持する(1)
);
/ *:
不明なデータテーブルと結合します{3}
Re:dt1のすべての行と、dt1の「Id」列と一致しないdt2の行でdt3を作成する方法は、dt1とdt2のいくつかの列しか表示しないあなたがする必要があるすべては使用することです
テーブル==>参加
メインテーブルとWithテーブルの両方で「一致しないものを含める」を指定します
/*I Want to get the result of: compare dt1 with dt2, if there are "Id" don't match then create a new table dt3 with dt1 all rows, and add the don't match rows in dt2 into dt1, and pick 3 columns(name, lot, EPval) show out in dt3. thanks a lot */
dt1 = New Table( "test",
addrows( 3 ),
New Column( "lot", character, values( {"K1", "K2", "K3"} ) ),
New Column( "Id", numeric, values( {"11889922", "11776620", "22889955"} ) ),
New Column( "EPval", numeric, values( {1, 2, .} ) ),
New Column( "Name", character, values( {"John", "Joe", "PP"} ) )
);
dt2 = New Table( "test",
addrows( 3 ),
New Column( "lot", character, values( {"K1", "K2", "K3"} ) ),
New Column( "Id", numeric, values( {"33888822", "11776620", "22889955"} ) ),
New Column( "EPval", numeric, values( {1, 2, .} ) ),
New Column( "Mgr", character, values( {"J", "H", "P"} ) )
);
// I assumed that there
dt3 = dt1 << Join( with(dt2),
By Matching Columns( :Id = :Id ),
Drop multiples( 0, 0 ),
Include Nonmatches( 1, 1 ),
Preserve main table order( 1 )
);Re:dt1のすべての行と、dt1の「Id」列と一致しないdt2の行でdt3を作成する方法は、dt1とdt2のいくつかの列しか表示しない表示しているコードは、私が投稿した修正済みのコードではありません。 修正されたJOINコードは
dt3 = dt1 << Join( with(dt2),
By Matching Columns( :Id = :Id ),
Drop multiples( 0, 0 ),
Include Nonmatches( 1, 1 ),
Preserve main table order( 1 )
);