This presentation will be step-by-step instructions (using slides) for creating 2 separate reports with BIP 11g. The first report will be tabular Multi-Project Status report with subtotaling on certain values (such as project manager). Each row will include standard project values such as Project ID, Name, Planned Start and Finish Dates, etc.. In addition, configurable project values such as project-level UDF’s and Project Codes will also be shown for each row. The second report will be a Pivot Table report which will pivot the variable number of weekly values for actual and remaining labor units for a list of projects. The presentation will include the development of the data models for both reports. In addition, the presentation part for both reports will be done with 2 different tools: 1. the Report Layout Editor (new in 11g) and 2. the BI Publisher Desktop component which is a Microsoft WORD add-on (formerly known as the WORD template builder). This presentation will include an explanation of the new P6 extended tables, the SQL for the data model to extract the data from P6, a review of the Report Layout Editor, and a review of BI Publisher Desktop component.
Referenced: www.p6academy.com
Source: http://coll15.mapyourshow.com
Islamabad Escorts | Call 03274100048 | Escort Service in Islamabad
P6R8.3 Using BI Publisher 11g - Create Multi-Project Status and Pivot Table Reports
1. REMINDER
Check in on the
COLLABORATE mobile app
P6R8.3 Using BI Publisher 11g
Create Multi-Project Status and Pivot Table Reports
Prepared by:
Paul G. Ciszewski, PMP
Dynamic Consulting
Session ID#: 200160
PCiszewski@Dynamic-Consulting.net
2. Overview
■ Oracle Business Intelligence Publisher (BIP) is a report
development tool to create pixel-perfect reports for P6,
CMv14 and Unifier
■ To modify existing P6 EPPM Web Reports and to create
new P6 EPPM Web Reports, BIP is used
■ When creating reports, you should use P6’s new Px
Extended Scheme (database)
■ Px Extended Scheme is a de-normalized database and
has P6 calculated values (such as Earned Value)
■ A de-normalized database simplifies report development
3. Overview (cont.)
We will demonstrate the development of two BIP reports.
First report:
■ Multi-Project Status Report (Report Name Project List)
▪ Users can select 1 project, multiple projects, or an EPS
▪ For each project, the following will be displayed: project
manager (prj code), phase (prj code), project ID, project name,
start date, finish date, planned hours, remaining hours, original
budget (UDF), and business case (UDF)
▪ Projects will be grouped and subtotaled by project manager and
then phase
6. Overview (cont.)
Here are the major steps to build a BIP report:
■ Develop the SQL - The SQL are the instructions for extracting the
data from the P6 Extended Database. Usually, SQL Developer is
used to develop and test the SQL (but you can enter the SQL
directly into the data model)
■ Build Data Model (DM) - The data model has the selections for the
report and the data sets (the SQL is entered into the data set)
■ Create XML data using the DM - Before you can build the
presentation part of the report, you must create XML data
■ Build Report – Which is the presentation part of the report using
either the Report Layout Editor or BIP Desktop (WORD Add-on).
Every Report is linked back to a DM – 1st build DM, then build
Report from DM
7. Tables
The following tables will be used in the first report
■ P6Project – this table has a list of all published projects
and related data (such as start date, finish date)
■ P6ProjectCodeAssignment – this table has all the
project code values assigned to every published project.
■ P6UDFType – this table has all the UDF definitions
(titles/labels, data type, subject area such as Project)
■ P6Project_UDFValue - this table has all the UDF values
assigned to all subject areas (such as Project, Activity,
etc.) however you need to look up the title/label in the
P6UDFType table then join with P6Project_UDFValue.
8. Develop SQL
■ SQL is a query language to extract (and update) databases
■ SQL is entered into the data sets in the Data Model
■ We usually use the SQL Developer tool to create and test the SQL
queries however you can use the Query Builder in BIP for simple
SQL queries
■ However, for all the reports that we develop for clients, we do not
use the Query Builder because it cannot handle the more complex
SQL queries
9. Develop SQL (cont.)
• Over the next few
slides, we will discuss
each section of the
SQL
• But I thought it would
be useful to see the
whole query
10. Develop SQL (cont.)
SELECT
-- Get some standard Project values
PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_SUMPLANNEDLABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_SUMREMAININGLABORUNITS,
-- Get UDF number value for Original Budget
NVL((SELECT UDFVALUE.UDFNUMBER
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'original budget'
),0) AS PRJ_UDF_ORIGINALBUDGET,
-- Get UDF text value for Business Case
NVL((SELECT UDFVALUE.UDFTEXT
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'business case #'
),' ') AS PRJ_UDF_BUSINESSCASE,
-- Get Project Code Description for Project Manager
NVL((SELECT PCA.PROJECTCODEDESCRIPTION
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'project manager'
), ' ') AS PRJ_PROJECTMANAGER,
-- Get Project Code Value for Current Phase
NVL((SELECT PCA.PROJECTCODEVALUE
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'current phase'
), ' ') AS PRJ_CURRENTPHASE
FROM P6PROJECT PRJ
WHERE PRJ.ID IN (:p_project_id)
ORDER BY PRJ_ID
• First, we will discuss
the main FROM clause
on the next slide
11. Develop SQL (cont.)
FROM P6PROJECT PRJ
WHERE PRJ.ID IN (:p_project_id)
ORDER BY PRJ_ID
• First we use the
project table called
P6PROJECT but use an
alias of PRJ
• We only extract
project records that
are in the parameter
“p_project_id” – but
we need to put a “:”
before the parameter
name
• The “ORDER BY”
clause will sort the
results by project id
12. Develop SQL (cont.)
SELECT
-- Get some standard Project values
PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_SUMPLANNEDLABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_SUMREMAININGLABORUNITS,
-- Get UDF number value for Original Budget
NVL((SELECT UDFVALUE.UDFNUMBER
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'original budget'
),0) AS PRJ_UDF_ORIGINALBUDGET,
-- Get UDF text value for Business Case
NVL((SELECT UDFVALUE.UDFTEXT
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'business case #'
),' ') AS PRJ_UDF_BUSINESSCASE,
-- Get Project Code Description for Project Manager
NVL((SELECT PCA.PROJECTCODEDESCRIPTION
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'project manager'
), ' ') AS PRJ_PROJECTMANAGER,
-- Get Project Code Value for Current Phase
NVL((SELECT PCA.PROJECTCODEVALUE
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'current phase'
), ' ') AS PRJ_CURRENTPHASE
FROM P6PROJECT PRJ
WHERE PRJ.ID IN (:p_project_id)
ORDER BY PRJ_ID
• Next, we extract some
standard values
directly from the
project table
(P6Project but we are
using the alias of PRJ.
13. Develop SQL (cont.)
SELECT
-- Get some standard Project values
PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_SUMPLANNEDLABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_SUMREMAININGLABORUNITS,
• In the P6Project table, some standard column names are ID, NAME, DATADATE,
STARTDATE.
• But we rename the columns/data elements with a prefix of PRJ_ID, PRJ_NAME,
etc.
• PRJ_ID, PRJ_NAME, etc. will be used when we build the presentation part of the
report
• NOTE: The 2 dashes “—” are comment lines
14. Develop SQL (cont.)
SELECT
-- Get some standard Project values
PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_SUMPLANNEDLABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_SUMREMAININGLABORUNITS,
-- Get UDF number value for Original Budget
NVL((SELECT UDFVALUE.UDFNUMBER
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'original budget'
),0) AS PRJ_UDF_ORIGINALBUDGET,
-- Get UDF text value for Business Case
NVL((SELECT UDFVALUE.UDFTEXT
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'business case #'
),' ') AS PRJ_UDF_BUSINESSCASE,
-- Get Project Code Description for Project Manager
NVL((SELECT PCA.PROJECTCODEDESCRIPTION
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'project manager'
), ' ') AS PRJ_PROJECTMANAGER,
-- Get Project Code Value for Current Phase
NVL((SELECT PCA.PROJECTCODEVALUE
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'current phase'
), ' ') AS PRJ_CURRENTPHASE
FROM P6PROJECT PRJ
WHERE PRJ.ID IN (:p_project_id)
ORDER BY PRJ_ID
• Next, we extract the
UDF value for 1 UDF
using a SELECT
statement and the
project’s unique ID.
• Note: In the extended
P6Project table, the
unique ID is called
“OBJECTID”. In the
native PROJECT table
the unique ID is called
“proj_id”
15. Develop SQL (cont.)
-- Get UDF number value for Original Budget
NVL((SELECT UDFVALUE.UDFNUMBER
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'original budget'
),0) AS PRJ_UDF_ORIGINALBUDGET,
• The inner SELECT statement is highlighted
• The NVL() function around the SELECT statement checks for a NULL result –
and if the result is a NULL, the NULL is changed to a 0
• The result is finally stored to a data element name of
“PRJ_UDF_ORIGINALBUDGET”
• More details on next slide
16. Develop SQL (cont.)
-- Get UDF number value for Original Budget
NVL((SELECT UDFVALUE.UDFNUMBER
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'original budget'
),0) AS PRJ_UDF_ORIGINALBUDGET,
• The inner SELECT statement uses the P6UDFTYPE and the
P6PROJECT_UDFVALUE tables.
• The WHERE clause finds the record with a UDF Type of “original budget”
• Using the OBJECTID from the P6UDFTYPE table, the WHERE clause links/joins
the P6UDFTYPE and the P6PROJECT_UDFVALUE tables
• The reason we use the SUBJECTAREA is to ensure we are using the UDF for the
project (and not some other subject area such as activity).
• We could have used the SUBJECTAREA on the P6UDFTYPE table too
• Lastly, we link/join the P6PROJECT and P6PROJECT_UDFVALUE tables
17. Develop SQL (cont.)
SELECT
-- Get some standard Project values
PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_SUMPLANNEDLABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_SUMREMAININGLABORUNITS,
-- Get UDF number value for Original Budget
NVL((SELECT UDFVALUE.UDFNUMBER
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'original budget'
),0) AS PRJ_UDF_ORIGINALBUDGET,
-- Get UDF text value for Business Case
NVL((SELECT UDFVALUE.UDFTEXT
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'business case #'
),' ') AS PRJ_UDF_BUSINESSCASE,
-- Get Project Code Description for Project Manager
NVL((SELECT PCA.PROJECTCODEDESCRIPTION
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'project manager'
), ' ') AS PRJ_PROJECTMANAGER,
-- Get Project Code Value for Current Phase
NVL((SELECT PCA.PROJECTCODEVALUE
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'current phase'
), ' ') AS PRJ_CURRENTPHASE
FROM P6PROJECT PRJ
WHERE PRJ.ID IN (:p_project_id)
ORDER BY PRJ_ID
• Next, we extract
another UDF value
(but this time a TEXT
value)
18. Develop SQL (cont.)
-- Get UDF text value for Business Case
NVL((SELECT UDFVALUE.UDFTEXT
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'business case #'
),' ') AS PRJ_UDF_BUSINESSCASE,
• This select for a UDF value is similar to the last one except the UDF is a TEXT
value (vs a numeric value)
• The title is different because it is a different UDF
• The NVL() function changes a NULL to a SPACE
• The result is stored in PRJ_UDF_BUSINESSCASE
• NOTE: The LOWER() function changes the value TITLE to lower case before the
compare therefore I don’t need to know the exact case of the TITLE
19. Develop SQL (cont.)
SELECT
-- Get some standard Project values
PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_SUMPLANNEDLABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_SUMREMAININGLABORUNITS,
-- Get UDF number value for Original Budget
NVL((SELECT UDFVALUE.UDFNUMBER
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'original budget'
),0) AS PRJ_UDF_ORIGINALBUDGET,
-- Get UDF text value for Business Case
NVL((SELECT UDFVALUE.UDFTEXT
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'business case #'
),' ') AS PRJ_UDF_BUSINESSCASE,
-- Get Project Code Description for Project Manager
NVL((SELECT PCA.PROJECTCODEDESCRIPTION
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'project manager'
), ' ') AS PRJ_PROJECTMANAGER,
-- Get Project Code Value for Current Phase
NVL((SELECT PCA.PROJECTCODEVALUE
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'current phase'
), ' ') AS PRJ_CURRENTPHASE
FROM P6PROJECT PRJ
WHERE PRJ.ID IN (:p_project_id)
ORDER BY PRJ_ID
• Next, we extract a
project code
description for a
project code called
‘Project Manager’
20. Develop SQL (cont.)
-- Get Project Code Description for Project Manager
NVL((SELECT PCA.PROJECTCODEDESCRIPTION
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'project manager'
), ' ') AS PRJ_PROJECTMANAGER,
• The inner SELECT statement is highlighted
• The NVL() function around the SELECT statement checks for a NULL result –
and if the result is a NULL, the NULL is changed to a SPACE
• The result is finally stored to a data element name of “PRJ_PROJECTMANAGER”
• More details on next slide
21. Develop SQL (cont.)
-- Get Project Code Description for Project Manager
NVL((SELECT PCA.PROJECTCODEDESCRIPTION
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'project manager'
), ' ') AS PRJ_PROJECTMANAGER,
• The inner SELECT statement uses the P6PROJECTCODEASSIGNMENT table
• The WHERE clause finds the record with a Project Code of “project manager”
• Using the PROJECTOBJECTID from the P6PROJECTCODEASSIGNMENT table, the
WHERE clause links/joins the P6PROJECT and the
P6PROJECTCODEASSIGNMENT tables
• Here, we extract the Project Code Description. In the next example, we extract
the Project Code Value
22. Develop SQL (cont.)
SELECT
-- Get some standard Project values
PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_SUMPLANNEDLABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_SUMREMAININGLABORUNITS,
-- Get UDF number value for Original Budget
NVL((SELECT UDFVALUE.UDFNUMBER
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'original budget'
),0) AS PRJ_UDF_ORIGINALBUDGET,
-- Get UDF text value for Business Case
NVL((SELECT UDFVALUE.UDFTEXT
FROM P6UDFTYPE UDFTYPE,
P6PROJECT_UDFVALUE UDFVALUE
WHERE
PRJ.OBJECTID = UDFVALUE.PROJECTOBJECTID AND
UDFVALUE.UDFTYPEOBJECTID = UDFTYPE.OBJECTID AND
LOWER(UDFVALUE.SUBJECTAREA) = 'project' AND
LOWER(UDFTYPE.TITLE) = 'business case #'
),' ') AS PRJ_UDF_BUSINESSCASE,
-- Get Project Code Description for Project Manager
NVL((SELECT PCA.PROJECTCODEDESCRIPTION
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'project manager'
), ' ') AS PRJ_PROJECTMANAGER,
-- Get Project Code Value for Current Phase
NVL((SELECT PCA.PROJECTCODEVALUE
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'current phase'
), ' ') AS PRJ_CURRENTPHASE
FROM P6PROJECT PRJ
WHERE PRJ.ID IN (:p_project_id)
ORDER BY PRJ_ID
• Next, we extract a
project code value for
a project code called
‘Current Phase’
23. Develop SQL (cont.)
-- Get Project Code Value for Current Phase
NVL((SELECT PCA.PROJECTCODEVALUE
FROM P6PROJECTCODEASSIGNMENT PCA
WHERE PRJ.OBJECTID = PCA.PROJECTOBJECTID AND
LOWER(PCA.PROJECTCODETYPENAME) = 'current phase'
), ' ') AS PRJ_CURRENTPHASE
• Very similar to the previous example for extracting project code assigned to
project But …
• Here we use a different Project Code called “Current Phase” and
• We extract the value instead of the description
• The result is stored to PRJ_CURRENTPHASE
24. Develop SQL(cont.)
■ The SQL for the data set is finished
■ Now, we will build the Data Model (DM)
■ To build the DM and sample data,
▪ Log into BIP
▪ Create new DM
▪ In the DM, create a List of Values
▪ In the DM, create a parameter (from the List of Values)
▪ In the DM, create a data set (using the SQL from the previous slides)
▪ Save the DM
▪ Using the DM, create XML data (sample data)
25. Build Data Model
• User Name should
exist in P6
• The user’s security is
applied
29. Build Data Model (cont.)
DM Main Screen
• We will create a
• list of values, then a
• parameter, then a
• data set
30. Build Data Model (cont.)
DM Main Screen
• Select the correct data source
• And check “Include Empty Tags for Null
Elements” so that all data elements are
shown in XML data
31. Build Data Model (cont.)
DM – List of Values (LOV)
• Create a LOV called ProjectLOV
• Type is “SQL Query” – and select Data Source
• Enter SQL Query
• The SQL query will
return a list of
Project ID’s
• The LOV is used
when we create
the Parameter
32. Build Data Model (cont.)
DM – Parameter
• Create a parameter
• The parameter “p_project_id” is a special
parameter recognize by P6
• Parameter Type is
Menu
• Use the LOV we
just created
• Allow multiple
selection
• Select “All Values
Passed” because
we use the “IN”
clause in the Data
Set’s SQL
33. Build Data Model (cont.)
DM – Data Set
• 1st, click on Data Sets
• 2nd, click on action
button
• 3rd, select “SQL Query”
option
• After “SQL Query” is
selected, the Data Set
screen is displayed (see
next slide)
34. Build Data Model (cont.)
DM – Data Set • 1st, enter a Data Set
name – and use the
Default Data Source
• Next.
• If the query is simple,
we could use the “Query
Builder”.
• However, we will
copy/paste the SQL that
we developed in the SQL
Developer tool.
35. Build Data Model (cont.)
DM – Data Set
• Click OK to check syntax
• After clicking OK, the
Data Elements created
by the Data Set are
shown (next slide)
36. Build Data Model (cont.)
DM – Data Set
• For each project record,
these are the available
data elements/columns
for the report
37. Build Data Model (cont.)
DM – Data Set
• Change the Group Name
from G_1 to “PrjList”
38. Build Data Model (cont.)
DM – Save and Generate XML Data
• Save
• Generate XML Data
– see next slide
39. Build Data Model (cont.)
DM – Generate XML Data then Save to DM
• XML Sample Data
• Select projects
• Change “Number of
Row” to All
• Click “Run”
40. Build Data Model (cont.)
DM – Save Sample Data to DM
• Select “Save As Sample Data”
which will save the data to the DM
• If we were building a report in the
Word Add‐on tool, we would use
“Export XML” instead
• Click action button
41. Build Data Model (cont.)
■ The DM is created and saved
■ Sample XML data was created
■ Now, we build the Report
■ To build the Report,
▪ Create new Report
▪ Select DM (that we just created)
▪ Create new Layout within the Report
▪ Save Layout and Report
▪ Move to P6Reports folder
▪ Reattach the DM to the “moved” Report
▪ Log into P6, select the Reports tab, expand folder nodes and run Report
43. Build Report (cont.)
Report – Select DM, Use Report Editor, and Save
• Select an existing DM
name – ProjectList
44. Build Report (cont.)
Report – Create Layout using Report Layout Editor
• Each Report will use 1
DM
• Each Report can have 1
to many Layouts
• Select a template for
the Layout
• In our example, we will
select
Blank/Landscape
45. Build Report (cont.)
Report – Blank Layout
• Here is the area where we will build
the report layout by adding objects to
this area. Objects such as layout grids,
text items, data tables, charts, etc.
46. Build Report (cont.)
Report – Blank Layout
• Here are the data
elements from the DM
that we can insert into
our layout
• Here are the objects
we can insert into the
layout
48. Build Report (cont.)
Report – Join Cells and Insert Data Table
• After cells are joined,
insert Data Table into
“joined” cell
• Now we can drop Data Elements into the table
50. Build Report (cont.)
Report – Drop Data Elements into Data Table
• Continue
dropping Data
Elements into
the table –
adjusting
column width
when
necessary
• NOTE: The
project
manager and
current phase
columns are to
the left so that
it is easier to
group and
subtotal by
these columns
• We need to
format these
date columns
51. Build Report (cont.)
Report – Format Date Columns
• 1st, select columns
• 2nd, select Data
Formatting and
select a
predefined
format
52. Build Report (cont.)
Report – Format Date Columns
• Next, change the column headers by
double clicking on the header and
entering the new header
• Continue adding other columns such as
Planned Units and Remaining Units
53. Build Report (cont.)
Report – Format Numeric Columns
• To format the
numeric columns,
select the columns
then select “Data
Formatting”.
• Total and subtotal
values are formatted
separately
54. Build Report (cont.)
Report
• Added a report header by joining the cells then adding a “Text Item”
object
• Also right justified the dates
• Next, we will add grouping and subtotaling by Project Manager then
by Phase
55. Build Report (cont.)
Report – Group By in Data Table
• To create a group by for
“Project Manager”, select
the column
• Then – select the “Column”
tab
• Then select “Group Left”
under “Grouping”
56. Build Report (cont.)
Report – Group By in Data Table
• Group By
“Project Manager”
To sort and subtotal
by “Project Manager”,
select the column
then click on Sort and
Subtotals
57. Build Report (cont.)
Report – Group By in Data Table
Repeat the same grouping for
the Phase column that was
done for the
“Project Manager” column
Also, add row labels for Phase
and PM Subtotal
58. Move Report to P6
■ The DM is created and tested
■ The Report is created and tested
■ To run a report from P6, the Report and DM must be moved to the P6Reports folder
62. 2nd Report
Second report:
■ Pivot Table Report
▪ Users can select 1 project, multiple projects, or an EPS
▪ Users select a starting date for the weekly data
▪ For all projects, the report will sum the following data on a
weekly basis: actual labor units and remaining labor units
▪ For each row/project, the Project ID, Name and Data Date will
be included
▪ The target output format is an Excel spreadsheet
64. Tables
The following tables will be used in the second report
■ P6Project – this table has a list of all published projects
and related data (such as start date, finish date)
■ P6ReportDate – this table has a record for every date
for all published projects. For example, if the earliest
date for any published project is June 1, 2011 and the
latest date is December 31, 2020 – then there would be
a record for every date in that timeframe.
By looking up a date, I can determine the starting week
for that date, the Julian date, the week of year, etc
■ P6ActivitySpread – this table has all activity data (such
as actual planned labor units) for each day for every
activity in all published tables
65. Build 2nd Report
DM Overview
1 LOV for projects
2 parameters –
Projects
Starting Date
2 Data Sets
Date Range
Activity Data
The Data Sets are
linked together so
that we get the date
range first, then
execute the SQL in the
ActData DS
69. Build 2nd Report
DM – DateRange Data Set
-- From the date selected by user, determine
-- the beginning of week date and
-- the ending week date (which will be 52 weeks)
-- FIRST_WEEK_DATE_STR and LAST_WEEK_DATE_STR will be used as
-- parameters in another data set
SELECT TO_CHAR(MIN(RPTD.WEEKBEGINDATE),'yyyy-mm-dd') AS FIRST_WEEK_DATE_STR,
TO_CHAR(MAX(RPTD.WEEKBEGINDATE),'yyyy-mm-dd') AS LAST_WEEK_DATE_STR
FROM P6REPORTDATE RPTD,
(SELECT INNER_RPTD.WEEKBEGINDATE
FROM P6REPORTDATE INNER_RPTD
WHERE TRUNC(INNER_RPTD.DAYDATE) = :p_startdate) WEEK_START_DATE
WHERE TRUNC(RPTD.DAYDATE) BETWEEN
WEEK_START_DATE.WEEKBEGINDATE AND (WEEK_START_DATE.WEEKBEGINDATE+363);
-- 363 is (52 weeks x 7 days MINUS 1 day)
70. Build 2nd Report
DM – DateRange Data Set (cont.)
-- From the date selected by user, determine
-- the beginning of week date and
-- the ending week date (which will be 52 weeks)
-- FIRST_WEEK_DATE_STR and LAST_WEEK_DATE_STR will be used as
-- parameters in another data set
SELECT TO_CHAR(MIN(RPTD.WEEKBEGINDATE),'yyyy-mm-dd') AS FIRST_WEEK_DATE_STR,
TO_CHAR(MAX(RPTD.WEEKBEGINDATE),'yyyy-mm-dd') AS LAST_WEEK_DATE_STR
FROM P6REPORTDATE RPTD,
(SELECT INNER_RPTD.WEEKBEGINDATE
FROM P6REPORTDATE INNER_RPTD
WHERE TRUNC(INNER_RPTD.DAYDATE) = :p_startdate) WEEK_START_DATE
WHERE TRUNC(RPTD.DAYDATE) BETWEEN
WEEK_START_DATE.WEEKBEGINDATE AND (WEEK_START_DATE.WEEKBEGINDATE+363);
-- 363 is (52 weeks x 7 days MINUS 1 day)
• Here, we get the starting day of week based on the date the user selected from
the P6ReportDate table
• Then, we extract all records from P6ReportDate starting with the first day of
week for 1 year (or 363 days)
• From that date range, get the earliest date and the latest date using MIN and
MAX functions. I convert the dates into strings because it is easier to pass
strings (rather than dates) to other data sets.
• In the ActData data set, FIRST_WEEK_DATE_STR and LAST_WEEK_DATE_STR will
be used as parameters.
72. Build 2nd Report
DM – ActData Data Set (cont.)
-- The SELECT statement in the WITH clause will extract all
-- activity spread data AND it will also determine which week the data
-- falls into
WITH ALL_DATA AS
(
SELECT PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.DATADATE AS PRJ_DATADATE,
TRUNC(RPTD.WEEKBEGINDATE) AS RPTD_WEEK_BEGIN_DATE,
TO_CHAR(TRUNC(RPTD.WEEKBEGINDATE),'YYYY-MM-DD') AS RPTD_WEEK_BEGIN_DATE_STR_SORT,
TO_CHAR(TRUNC(RPTD.WEEKBEGINDATE),'MM/DD/YY') AS RPTD_WEEK_END_DATE_STR,
NVL(ACTS.ACTUALLABORUNITS, 0) AS ACTS_ACTUALLABORUNITS,
NVL(ACTS.REMAININGLABORUNITS,0) AS ACTS_REMAININGLABORUNITS
FROM P6PROJECT PRJ,
P6ACTIVITYSPREAD ACTS,
P6REPORTDATE RPTD
WHERE PRJ.ID IN (:p_project_id) AND
ACTS.PROJECTOBJECTID = PRJ.OBJECTID AND
TRUNC(ACTS.STARTDATE) = TRUNC(RPTD.DAYDATE)
)
-- END OF WITH CLAUSE
-- This SELECT statement will use the results from the
-- WITH clause - and group and sum the data by project
-- and week
SELECT PRJ_ID,
PRJ_NAME,
PRJ_DATADATE,
RPTD_WEEK_BEGIN_DATE,
RPTD_WEEK_BEGIN_DATE_STR_SORT,
RPTD_WEEK_END_DATE_STR,
SUM(ACTS_ACTUALLABORUNITS) AS SUM_ACTUALLABORUNITS,
SUM(ACTS_REMAININGLABORUNITS) AS SUM_REMAININGLABORUNITS
FROM ALL_DATA
WHERE RPTD_WEEK_BEGIN_DATE BETWEEN
TO_DATE(:FIRST_WEEK_DATE_STR,'yyyy-mm-dd') AND TO_DATE(:LAST_WEEK_DATE_STR,'yyyy-mm-dd')
GROUP BY PRJ_ID,
PRJ_NAME,
PRJ_DATADATE,
RPTD_WEEK_BEGIN_DATE,
RPTD_WEEK_BEGIN_DATE_STR_SORT,
RPTD_WEEK_END_DATE_STR
ORDER BY RPTD_WEEK_BEGIN_DATE_STR_SORT;
73. Build 2nd Report
DM – ActData Data Set (cont.)
-- The SELECT statement in the WITH clause will extract all
-- activity spread data AND it will also determine which week the data
-- falls into
WITH ALL_DATA AS
(
SELECT PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.DATADATE AS PRJ_DATADATE,
TRUNC(RPTD.WEEKBEGINDATE) AS RPTD_WEEK_BEGIN_DATE,
TO_CHAR(TRUNC(RPTD.WEEKBEGINDATE),'YYYY-MM-DD') AS RPTD_WEEK_BEGIN_DATE_STR_SORT,
TO_CHAR(TRUNC(RPTD.WEEKBEGINDATE),'MM/DD/YY') AS RPTD_WEEK_END_DATE_STR,
NVL(ACTS.ACTUALLABORUNITS, 0) AS ACTS_ACTUALLABORUNITS,
NVL(ACTS.REMAININGLABORUNITS,0) AS ACTS_REMAININGLABORUNITS
FROM P6PROJECT PRJ,
P6ACTIVITYSPREAD ACTS,
P6REPORTDATE RPTD
WHERE PRJ.ID IN (:p_project_id) AND
ACTS.PROJECTOBJECTID = PRJ.OBJECTID AND
TRUNC(ACTS.STARTDATE) = TRUNC(RPTD.DAYDATE)
)
-- END OF WITH CLAUSE
• The results of the WITH clause are stored in ALL_DATA.
ALL_DATA can be used like a table later in other SELECT statement
• The SELECT statement (within the WITH) will extract ALL activity spread data on a daily
basis for all projects. Also – for each record, we get the project id, name, data date and
(based on the date) the beginning day of week as a string in 2 formats (for to be used for
display and the other for sorting dates across the top from Left to Right)
74. Build 2nd Report
DM – ActData Data Set (cont.)
-- This SELECT statement will use the results from the
-- WITH clause - and group and sum the data by project
-- and week
SELECT PRJ_ID,
PRJ_NAME,
PRJ_DATADATE,
RPTD_WEEK_BEGIN_DATE,
RPTD_WEEK_BEGIN_DATE_STR_SORT,
RPTD_WEEK_END_DATE_STR,
SUM(ACTS_ACTUALLABORUNITS) AS SUM_ACTUALLABORUNITS,
SUM(ACTS_REMAININGLABORUNITS) AS SUM_REMAININGLABORUNITS
FROM ALL_DATA
WHERE RPTD_WEEK_BEGIN_DATE BETWEEN
TO_DATE(:FIRST_WEEK_DATE_STR,'yyyy-mm-dd') AND TO_DATE(:LAST_WEEK_DATE_STR,'yyyy-mm-dd')
GROUP BY PRJ_ID,
PRJ_NAME,
PRJ_DATADATE,
RPTD_WEEK_BEGIN_DATE,
RPTD_WEEK_BEGIN_DATE_STR_SORT,
RPTD_WEEK_END_DATE_STR
ORDER BY RPTD_WEEK_BEGIN_DATE_STR_SORT;
• Using the results from the WITH clause
• We sum the actual labor units and remaining labor units based on the beginning day of
week
• For only the dates in our date range using the parameters :FIRST_WEEK_DATE_STR and
:LAST_WEEK_DATE_STR
76. Build 2nd Report
■ The 2nd Report will be created using BI Desktop (the
WORD add-on)
■ From the DM, we need to create a sample XML data file
that will be imported into WORD
■ Create XML data just like before by clicking on the XML
button but after generating the XML, save XML to a file
instead of saving to DM
77. Build 2nd Report
DM – Create XML file
Select “Export XML” to create a file
The file will be loaded into WORD
later
78. Build 2nd Report
WORD Add-on
■ Go to WORD
■ Select “BI Publisher” tab
■ Load XML Data using “Sample XML”
■ Build Report with WORD Add-on – add a Pivot Table
80. Build 2nd Report
WORD Add-on – Pivot Table
First drag and drop the
values for the left‐most
columns (Prj_ID,
Prj_Name, and
Prj_DataDate)
Next, drag and drop
Rptd_Week_Begin_Date_
Str to top (not the one
with SORT).
This will be the dates
across the top of the
report
81. Build 2nd Report
WORD Add-on – Pivot Table
Next, drag and drop the
data elements that will be
displayed under each date
Then, modify some
properties.
Change RowStyle to
“Inline” and set the
subtotaling values.
Then click “OK”
82. Build 2nd Report
WORD Add-on – Pivot Table
BIP builds the logic for the
Pivot Table
If we preview, the report
will look like
83. Build 2nd Report
WORD Add-on – Pivot Table
To format a data element (such
as RPTD_WEEK_BEGIN_DATE),
select it then do a right click
then select “BI Publisher” then
select Properties
Then format the other data
elements the same way
84. Build 2nd Report
WORD Add-on – Pivot Table
■ But there is 1 problem that needs to be resolved.
I want to display the date in MM/DD/YY format but if the
dates are sorted using this format, “12/01/14” would be
displayed after “01/01/15”
To correct this problem, I created 2 date data elements in
the DM – one with “mm/dd/yy” format for display and one
with “yyyy-mm-dd” format for sorting
Next, we will modify the XSL/XPATH code behind the pivot table
to use a sort data element.
85. Build 2nd Report
WORD Add-on – Pivot Table – Add Sort to Dates
After modifying the titles
and formatting the data, the
report looks like this.
To modify the sort, select
the “C” in the upper left‐
hand corner – right click and
view the BI Publisher
properties
86. Build 2nd Report
WORD Add-on – Pivot Table – Add Sort to Dates
Same code as above but I
added carriage returns so it
is easier to read
■ <?crosstab:c79844;"//ACTDATA";
■ "PRJ_ID{,o=a,t=t},
■ PRJ_NAME{,o=a,t=t},
■ PRJ_DATADATE{,o=a,t=t}"
■ ;
■ "RPTD_WEEK_BEGIN_DATE{,o=a,t=t}"
■ ;
■ "SUM_ACTUALLABORUNITS,SUM_REMAININGLABORUNITS";"sum"?>
87. ■ <?crosstab:c79844;"//ACTDATA";
■ "PRJ_ID{,o=a,t=t},
■ PRJ_NAME{,o=a,t=t},
■ PRJ_DATADATE{,o=a,t=t}"
■ ;
■ "RPTD_WEEK_BEGIN_DATE{,o=a,t=t}"
■ ;
■ "SUM_ACTUALLABORUNITS,SUM_REMAININGLABORUNITS";"sum"?>
Build 2nd Report
WORD Add-on – Pivot Table – Add Sort to Dates
To add the SORT data
element (already in my DM),
insert the data element
name between the “{“ and
the “,”
■ <?crosstab:c79844;"//ACTDATA";
■ "PRJ_ID{,o=a,t=t},
■ PRJ_NAME{,o=a,t=t},
■ PRJ_DATADATE{,o=a,t=t}"
■ ;
■ "RPTD_WEEK_BEGIN_DATE{RPTD_WEEK_BEGIN_DATE_STR_SORT,o=a,t=t}"
■ ;
■ "SUM_ACTUALLABORUNITS,SUM_REMAININGLABORUNITS";"sum"?>
88. Build 2nd Report
WORD Add-on – Upload Report to BIP
Save report as RTF file
Create a Report in BIP
Upload RTF file to BIP – there are a couple methods but I’ll
upload the file from within BIP
89. Build 2nd Report
WORD Add-on – Upload Report to BIP
In BIP, create Report using
the PivotTable DM.
Then Upload RTF using
90. Build 2nd Report
WORD Add-on – Upload Report to BIP
After you upload the
RTF file, change the
output formats to
“Excel Only” formats
under “View a List”
(see next slide)
93. Please complete the session
evaluation
We appreciate your feedback and insight
You may complete the session evaluation either
on paper or online via the mobile app
95. If you would like all the Data Models, Reports and SQL used to
create these presentation, please send an email to:
Paul G. Ciszewski, PMP
(920) 883-9048
PCiszewski@Dynamic-Consulting.net