Issue: Recently faced an issue with a client regarding Project Server 2013 Resource Capacity Planning Report. The client had some old projects uploaded and they wanted to view the resource capacity and allocated hours for last few months. They were only able to see information for one last month only.
Solution: The solution has two steps –
- Central Administration changes –
- In SharePoint Central Administration, click Application Management.
- On the Application Management page, in the Service Application section, click Manage Service Applications.
- On the Service Applications page, click the Project Application Service that contains the Project Web App instance for which you want to access the Resource Capacity settings.
- On the Manage Project Web Apps page, click the drop-down menu for the PWA instance for which you want to access the Resource Capacity settings, and click Manage.
- On the Server Settings page, in the Operational Policies section, click Additional Server Settings.
- On the Additional Server Settings page, in the Resource Capacity Settings section, for Active capacity view, enter the following:
- In the Months behind field, enter the number of months in the past that you want resource data to be calculated from. I changed it to 12.
- In the Months ahead field, enter the number of months in the future that you want resource data to be calculated from. Kept the default to 12.
- Click Save.
- You will have to run the timer job Project Server: Resource Capacity Refresh job for Project Server Service Application for getting the report refreshed with old dates.
- Open the ResourceCapacityPlanning Report in excel.
Click on Data -> Connections.
On Connections Select Project Server – Resource Capacity and click Properties
On Properties Window click on Definition Tab.
On Definition Window check the Command Text column
The SQL Command text should look like –
(SELECT ResourceName from MSP_EpmResource_UserView where MSP_EpmResource_UserView.ResourceUID = MSP_EpmResourceByDay_UserView.ResourceUID) as [ResourceName],
MSP_EpmResourceByDay_UserView.ResourceUID as [ResourceUID],
ISNULL(AssignmentTable.AllocatedCapacity,0) as [AllocatedCapacity],
MSP_EpmResourceByDay_UserView.Capacity as [ResourceCapacity],
DATENAME(month, MSP_EpmResourceByDay_UserView.TimeByDay) as [Month],
YEAR(MSP_EpmResourceByDay_UserView.TimeByDay) as [Year],
(SELECT [RBS] from MSP_EpmResource_UserView where MSP_EpmResource_UserView.ResourceUID = MSP_EpmResourceByDay_UserView.ResourceUID) as [RBS]
LEFT OUTER JOIN
SUM(MSP_EpmAssignmentByDay_UserView.AssignmentCombinedWork) as [AllocatedCapacity],
ON MSP_EpmAssignment_UserView.AssignmentUID = MSP_EpmAssignmentByDay_UserView.AssignmentUID
AND MSP_EpmAssignment_UserView.ProjectUID = MSP_EpmAssignmentByDay_UserView.ProjectUID
AND MSP_EpmAssignment_UserView.TaskUID = MSP_EpmAssignmentByDay_UserView.TaskUID
CONVERT(DATETIME, DATEADD(month, – 2, CURRENT_TIMESTAMP), 102)
AND CONVERT(DATETIME, DATEADD(month, 6, CURRENT_TIMESTAMP), 102)
) AS AssignmentTable
ON AssignmentTable.ResourceUID = MSP_EpmResourceByDay_UserView.ResourceUID
AND AssignmentTable.TimeByDay = MSP_EpmResourceByDay_UserView.TimeByDay
(MSP_EpmResourceByDay_UserView.TimeByDay > CONVERT(DATETIME, DATEADD(month, – 2, CURRENT_TIMESTAMP), 102))
AND (MSP_EpmResourceByDay_UserView.TimeByDay < CONVERT(DATETIME, DATEADD(month, 6, CURRENT_TIMESTAMP), 102))
Find all instances of CONVERT(DATETIME, DATEADD(month, – 2, CURRENT_TIMESTAMP), 102)) and change the -2 to the months you are interested in going back. There are two instances. I have bolded the text in the SQL above. The client was looking for 3 months back so I changed it to –
CONVERT(DATETIME, DATEADD(month, -3, CURRENT_TIMESTAMP), 102))
Save the file and now your report should pull the appropriate data.