I have two queries which are containing one with sales data which is grouped is grouped by month, employee name, product name and sum of Sales Amount and secound query which is grouped by Month, Employee Name, product name and the assigned target.
Below is the [Sales Query] SQL view.
[Employees Target Query] SQL View
Now I need to compare the each employees sales vs their assigned target with % of the acchivement in a pivot table.
Please any one could help me out?
Below is the [Sales Query] SQL view.
Code:
SELECT [Master Sales Query].[Branch Sales Name], [Master Sales Query].Month, [Master Sales Query].[Product Name], Sum(Nz([Net Sales],0)) AS Sales FROM [Master Sales Query] GROUP BY [Master Sales Query].[Branch Sales Name], [Master Sales Query].Month, [Master Sales Query].[Product Name] ORDER BY [Master Sales Query].[Branch Sales Name], [Master Sales Query].Month;
Code:
SELECT [pEmployees Target].[Branch Sales Name], Month([TargetDate]) AS [Month], [pEmployees Target].[Product Name], Sum(NZ([Target],0)) AS [Target YTM] FROM [pEmployees Target] GROUP BY [pEmployees Target].[Branch Sales Name], Month([TargetDate]), [pEmployees Target].[Product Name], [pEmployees Target].TargetDate;
Please any one could help me out?
Comment