mrchonginhk
Well-known Member
- Joined
- Dec 3, 2004
- Messages
- 679
How to use Power Query to do INSERT INTO table 1 from table2 (not UNION) without VBA
I am not allowed to use VBA on my project so I am trying to use PowerQuery
I have 2 tables in their respective worksheet in the same workbook.
TableA is the master data table.
TableB is new records table which is adding records per day but any record of prior day will be wiped out before new records are added.
I need to repeatedly add Table B into Table A.
I am using Excel Power Query to Append these two Tables but what it does is only stick 2 tables together based on the data now.
What I want is, for example, in day 1, Table B has record ABC.
Then I want on run query the 1st day, Table A = Original Table A + ABC
The next day when Table B is updated as XYZ,
I want on 2nd run, the Table A become
Original Table A + ABC + XYZ
Right now the Merge query is only giving me Original Table A + XYZ (ie original Table A + latest Table B only) on 2nd run. ie this is only a UNION query,
not really an Append Query....
I am using below but it fails
let
Source = Table.InsertRows(Table1,0,Table.ToList(Table2))
in
Source
Pls help. Thanks
I am not allowed to use VBA on my project so I am trying to use PowerQuery
I have 2 tables in their respective worksheet in the same workbook.
TableA is the master data table.
TableB is new records table which is adding records per day but any record of prior day will be wiped out before new records are added.
I need to repeatedly add Table B into Table A.
I am using Excel Power Query to Append these two Tables but what it does is only stick 2 tables together based on the data now.
What I want is, for example, in day 1, Table B has record ABC.
Then I want on run query the 1st day, Table A = Original Table A + ABC
The next day when Table B is updated as XYZ,
I want on 2nd run, the Table A become
Original Table A + ABC + XYZ
Right now the Merge query is only giving me Original Table A + XYZ (ie original Table A + latest Table B only) on 2nd run. ie this is only a UNION query,
not really an Append Query....
I am using below but it fails
let
Source = Table.InsertRows(Table1,0,Table.ToList(Table2))
in
Source
Pls help. Thanks
Last edited: