Calculating an employee's performance versus goals

Hi Experts, I have a group of employees in a sales department who are paid based on actual results versus goals in the region(s) where they work.  An employee can work in one region for the entire year, or they can have a mid-year move between one region and another, or they can be shared across regions, or they can have a combination of these scenarios (see Employee_tbl for some examples).  

Actual results for regions are reported monthly as the year progresses, with the latest month reported shown in the Period_tbl.  Goals are known for all 12 months of the year for each region.  For the length of each assignment, the sum of Actual results is compared to the sum of the Goals.  But, I’m looking for a full-year estimate of performance, and for any unreported months of an assignment, the Goal is used as a proxy for the Actual results.  For example, Employee_001’s Actual results would be calculated by taking the sum of the Actual results for RegA from Jan through Sep and then adding the Goals from Oct through Dec. (i.e. 920 + 230).  Employee_001’s Goals would be calculated by taking the sum of the goals from Jan through Dec (i.e. 1,060) – please see Performance_tbl.  

The output that I am looking for via a query is a value for the Actual results and a value for the Goals, for each assignment, for each employee, as shown in the Output_tbl.  Thank you.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jeffrey CoachmanMIS LiasonCommented:
Perhaps this is just sample data and this may be irrelevent...

The first thing I will say is that the employee table should be a table of only the unique employees.
(Things specific to each employee)

Now, if one employee can have many regions, then you need a Many-To-many table:


You also need this to be linked to a unique Regions table
(Things specific to the Region)

Let's see if an expert can come along and address your question directly....

GIStewartAuthor Commented:
Jeff, thank you.  I follow your points, but these tables are coming from another source as is, so this is what I have to work with
Do you need it to be a query or could it be code behind a form that produces a report, display, or puts the information into a table for later use in reporting?

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Test this:
Open Query1. Results differs from your sample, but I think it should be correct.
You can set period in table Period_tbl
Hamed NasrRetired IT ProfessionalCommented:
Show how do you manually calculate the Actual, and Goal columns shown in the Output_tbl.
GIStewartAuthor Commented:

when I keep the month as 12, your numbers tie to mine for RegA assignments, but not for the other assignments and also not when I change the month.

I changed the period back to 9, to reflect the Performance table where I only had results through Sep, and this also tests the different ways the calculations have to work.  Employee_001's Actual Results should be calculated by taking the sum of the Actual results for RegA from Jan through Sep and then adding the Goals for RegA from Oct through Dec. (i.e. 920 + 230).  Employee_001’s Goals would be calculated by taking the sum of the goals from Jan through Dec (i.e. 1,060).  In other words, for any assignment where the end date is later than the Period month, I assume that the Actual results are going to match the Goals.  

To give you another example of the last sentence, with the period still set at 9: for Employee_002, their actual results for the RegB assignment should be calculated by taking the sum of the Actual results from May through Sep (1,300 + 1,100 + 1,000 + 800 + 900) and then adding the Goals from Oct through Dec (1,100 + 700 + 500) for a total of 7,400.  Their Goals would be calculated by taking the sum of the goals from May through Dec, i.e. 6,500.

Hope this helps.
OK, test new version. Results are in Query2. Weight is already calculated. EE-MA-sample.mdb

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dale FyeOwner, Developing Solutions LLCCommented:
I responded in the Experts area, but I'll put it here for good measure.

When you nest queries like this, you should always explicitly declare the parameters you are using.  In this case the reference to the combo box.  You can do this by adding the following line to the top of the SQL string of qry_HR.

PARAMETERS [Forms]![frm_Year_Selection]![cbo_Year] Text ( 255 );

But when I run this, no matter which "year" I select, I get the same results, so I assume that you need to do some modifications to the criteria of qry_HR.
GIStewartAuthor Commented:
Sorry for the delay in closing this one out (other projects to manage), but this solution worked perfectly.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.