Merge Queries. Keep rows if the same, add if there are new ones.

RogerPenna

New Member
Joined
Mar 27, 2017
Messages
20
Hi everybody.

So, we have these tables with
-Contract Numbers
-Date
-Service Description
-Quantities

We have this legacy table that has 16 thousand rows, for 3 years of contracts, with several services per month per contract.


We need to keep this Legacy Table data, but we want add data from files that will be put in a folder... each file corresponding to the services of a single month of a single contract (yes, it's stupid, but that's because how the Export from a legacy program we have work)

So, the inclusion of files in a folder, and them becoming a single table already works. I made several transforms, so PowerQuery gets the date and contract number from the header of the files and create columns for them, etc.

And then I have this other table with 16 thousand rows with legacy data.

I want to create a merge where I will have the old legacy data AND the new data being inserted montly in the folder.

But no merge I try gives me the wanted result, which is to get the LEGACY DATA table, ADD new ROWS (not columns) if they don´t exist, and UPDATE VALUES of old rows, if they have changed.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,223,637
Messages
6,173,489
Members
452,515
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top