Dealing with duplicates in my data

shophoney

Active Member
Joined
Jun 16, 2014
Messages
281
Hi I have a list of employees coming from my payroll program. Unfortunately the file pulls out each employee and each costing location you can work at. I'm trying to link the employee table to the sales table. But it says both sides have a many.

What would be the best way to have a ONE TO MANY. Should I take the data each week and run VBA to remove the duplicates. Or can i write a powerpivot formula to deal with it.

So Table1 is my employees and it lists you many times as you can work at each location (no control on getting the list any different). Table 2 is the sales table listing all your sales for each cycle.

Thoughts?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi shophoney - You might consider creating a VBA script that eliminates the duplicates in Table1. I can't see any reason you would want an employee listed twice in a list of employees.
 
Upvote 0
This sounds similar to our hospitals where nurses can work at multiple locations and thus have several HR records showing their different pay rates, supervisors etc.

Assuming you are using PowerQuery to load your data to the model, extract your HR data into a lookup table. Create a separate query, load the HR file, and eliminate duplicates (you may want to keep other columns of the data such as SSN, original hire date, etc.) Then link the employee lookup table to the HR and sales table. That way you preserve the HR multiple row data in case you want to calculate average pay across locations or something like that.
 
Upvote 0

Forum statistics

Threads
1,214,411
Messages
6,119,346
Members
448,888
Latest member
Arle8907

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