Project Management

Add Task Outline codes to Project's Portfolio Analyzer OLAP cube

The Project Server Portfolio Analyzer doesn't recognize Task Outline codes as dimensions, but here's a macro that lets you trick it into including this data in its handy pivot-style tables.

The Project Server Portfolio Analyzer allows administrators to create pivot table-style reports of resource and assignment data, such as work, cost, and availability. The dimensions by which you “pivot” this data are the Project, Resource, and Assignment Enterprise Outline codes you define in the Enterprise Global template. These codes capture and chart such information as resource skill, location, project type, and organizational breakdown structure (OBS). You can also define such outline code fields for tasks, but they don’t appear as dimensions in Portfolio Analyzer. However, here’s a quick workaround that will allow you to see task level outline codes as Analyzer dimensions.

The Portfolio Analyzer doesn’t recognize Task Outline codes as dimensions, period. But Project Server does something interesting with Resource Enterprise Outline codes that we can use to get our Task Outline codes into the Analyzer. Project Server copies the values of any Resource Enterprise Outline code into an Assignment Enterprise Outline code field that it defines. We’ll use this inheriting behavior to trick Project Server into creating an Assignment level code field for us, and then we’ll use a macro to move the Task field value into the Assignment field. The Assignment field will then be treated as a dimension, and it will contain the task-based information from the task to which it belongs.

Setting up the fields
The first step of this process is to correctly set up the fields. Let’s use Task Location as an example. Several of your projects happen across geographic locations, so you want to have a way of seeing exactly where your tasks are taking place. This will help you make sure you’re assigning the right resources based on their locations. To do this, you’ll use an Enterprise Task Outline code that you’ll call Task Location.

To set up this code, open the Enterprise Global template by logging into Project 2002 Professional as a user with Project Server administrator rights. Then, click on Tools | Enterprise Options | Open Enterprise Global. Once in Enterprise Global, you can start adding code fields by clicking Tools | Customize | Enterprise Fields. Click on the Outline Codes tab, and you’ll see the Customize Enterprise Fields dialog box, shown in Figure A.

Figure A

Select an unused code and click the Rename button. Rename the code to Task Location and click OK. Now click on the Define Code Mask button to open the Outline Code Definition dialog box, which allows you to define the “layout” of the code field. For this example, set up your dialog like the one shown in Figure B.

Figure B

This configuration tells Project to expect values for this field on two levels; both levels can contain any number of characters. From here, click on the Edit Lookup Table button, which lets you define the values from which users can populate the outline code field. Figure C shows you a sample outline structure for our Location field.

Figure C

The outline structure of this field will allow you to report on individual cities or on the higher state level. When you have entered the outline structure for your Location field, click Close and then click OK in the Code Mask dialog box. This will bring you back to the Customize Enterprise Fields dialog. If you want to make this field mandatory, you can select the Make This A Required Code check box.

Now you need to set up a corresponding Task Location field in the Resource outline codes. Click the Resource option at the top of the dialog box to see the Resource outline codes. Click on an unused code field and give it a similar name as the Location field you just created; for our example, this will be Task Location. Make a note of which field it is (1-30), because you’ll need that information when you create your macro. (In our example, it’s Enterprise Resource Outline Code 5.) Then select the Share Another Code’s Lookup Table check box and click the Choose Outline Code button. Figure D shows the dialog box you’ll use to pick the outline code. In this case, you'll pick Task for Field Type and Task Location for Field Name.

Figure D

Click OK when you’re finished, and then OK in the Customize Enterprise Fields dialog.

We’re finished setting up the fields. Now we need to write the macro that will place the values picked for a task in the Task Location field into the corresponding Assignment Outline code field.

The macro
We’ll insert the macro shown in Listing A into the Enterprise Global template. Note where we’ve inserted EnterpriseResourceOutlineCode5, the location of our Task field.

If you decided to track more than one Task Outline Code, you would repeat the field creation process covered above and add a second line like this one, which you’ll see in the macro above:
asnA.EnterpriseResourceOutlineCode5 = _

Instead of EnterpriseResourceOutlineCode5 and tskT.EnterpriseOutlineCode1, you’d use the information for whichever fields you customized for the additional field. So, if you decided to add a field to track the kind of task that was being done (e.g., Design, Code, Test, Deploy), you might customize Task Enterprise Outline Code 2 and call it Type. You would then customize a Resource Enterprise Outline Code field to be named similarly. This Resource field might be Enterprise Outline Code 6. In this case, you would add the following below the line we discussed above:
asnA.EnterpriseResourceOutlineCode6  = _

While you still have the Enterprise Global template open, click Tools | Macros | Visual Basic Editor. Double-click the tree element called ThisProject (Checked-Out Enterprise Global). Then copy the code in Listing A. When you’re finished, your screen should look something like the one in Figure E.

Figure E

Close the Visual Basic Editor and click Save to save the Enterprise Global template. Now every time an enterprise user saves a project, the values in the Task Location field will be copied into the corresponding Assignment field. The next time the Portfolio Analyzer OLAP cube is rebuilt, you’ll see a dimension called Assignment Task Location.

Editor's Picks