Create bar chart report for p6 r8.3 using bi publisher 11g - Oracle Primavera P6 Collaborate 14
1. REMINDER
Check in on the
COLLABORATE mobile app
Create Bar Chart Report
for P6R8.x using BI Publisher 11g
Prepared by:
Paul G. Ciszewski, PMP
Dynamic Consulting
Session ID#: 15441
2. Overview
• Oracle Business Intelligence Publisher (BIP) is a tool to create pixel-perfect
reports
• To modify existing P6 EPPM Web Reports and to create new P6 EPPM Web
Reports, BIP is used
• When building your reports, you should use P6’s new Px Extended Scheme
(database)
• Px Extended Scheme is de-normalized and has P6 calculated values
3. Overview (cont.)
Tables in the Px Extended Scheme begin with “P6”
• P6Project – list of all projects and related data by project (for ex: the “baseline
planned labor units” for project “TA Fall 13”)
• P6ProjectSpread - list of all projects and related data by project and date (for ex:
the “planned labor units” on November 15, 2013 for project “TA Fall 13”)
• P6Activity – list of all activities and related activity data for all projects (for ex: the
“earned value labor units” for activity “A1000” for project TA Fall 13)
• P6ActivitySpread – list of all activities and related activity data by date for all
projects (for ex: the “actual labor units” for activity “A1000” on November 15, 2013
for project TA Fall 13)
• P6ActivityCodeAssignment – list of all the activity codes and their values
assigned to ALL activities. If an activity has 5 activity codes assigned to it, then
there would be 5 records in this table for the one (1) activity
• P6ActivityCodeType – list of all activity codes (referred to as Activity Code Types)
Note: There are no physical tables called P6Project (or P6Activity). The P6 tables are actually synonyms/aliases that
point to “Views”. “Views” are results from executed SQL statements. In the Px Extended Scheme, the “Views” are joins
of native P6 tables (such as project, task) and new extended tables (such as projectx and taskx) – and the P6 security
tables are included.
For our presentation “SYNONYM” is the same as “TABLE”
4. BI Publisher - Introduction
• Two (2) main steps to create a BIP report
1. Create Data Model – Using DM Editor to extract data from P6’s Extended
Px Scheme (database)
2. Create Report Layout – to present the data. But there are 2 tools to
create the presentation part:
Report Layout Editor (web tool which is within BIP)
Word Template Builder (a MS WORD add-on)
5. BI Publisher – Presentation Objective
Presentation Objective
Go through all the steps to:
1. Develop the Data
Model (SQL) to extract
the data from P6
2. Develop the Bar Chart
Template in the WORD
Template Builder that
uses the Data Model
3. Upload the Template
to the Report in BI
Publisher
4. Move the Report and
Data Model to the
P6Reports folder
5. Run Bar Chart Report
in P6 and produce the
same output as you
see on this slide
6. BI Publisher – Report Details
Report Details
1. The user selects a project and
an activity code (such as Team)
2. The Data Model will group and
sum all with the same Activity
Code Value (such as ELEC)
3. Display values (such as Planed
Hours and BL Start Date) based
on group of activities with the
same value (ELEC).
4. Create a bar (the gray bar)
representing the earliest start
date and the latest finish date
for the group of activities with
the same value (ELEC).
5. Create an inner bar (the red
bar) representing the
percentage of Earned Value for
the group of activities with the
same value (ELEC).
6. This report was designed to
handle a 3 month project. The
hash marks are not
dynamically created
7. BI Publisher - Login
• User Name should
exist in P6
• The user’s security is
applied
9. BI Publisher – Create Data Model (DM)
Eight (8) components need to be created within the DM for our
example
1. Create 2 List of Values (LOV)
2. Create 2 parameters
3. Create 4 Data Sets
See next slide for view of completed DM
11. BI Publisher – Create New DM
Check “Include Empty Tags
for Null Elements” too.
We want all data elements
from the P6 DB even if the
data elements are null
12. BI Publisher – Create New DM – P6 Tables
Five (5) P6 Tables needed to create DM
1. P6Project (list of projects and all related data)
2. P6Activity (list of activities and all related data)
3. P6ActivitySpread (list of activities and activity data by date)
A data set was included to determine the number of hours that was supposed
to be done up the data date (based on the baseline) but the data elements
were not used in our report. HOWEVER this extra data could be used to
expand the report.
4. P6ActivityCodeAssignments (list of ALL activity codes and their values
assigned to EVERY activity)
5. P6ActivityCodeType (list of ALL activity codes defined in your P6 DB)
13. BI Publisher – Create DM – Parameter
Desired “look and feel” in P6
14. BI Publisher – Create DM – Parameter
Desired “look and feel” in P6 for selecting a project
15. BI Publisher – Create DM – Parameter
Desired “look and feel” in P6 for selecting an activity code
16. BI Publisher – Create DM - Parameter
First create two (2) list of values (LOV)
• 1 for Projects and
• 1 for Activity Codes
17. BI Publisher – Create DM – Create LOV’s
SQL to retrieve the list of Project ID’s for
projects that are active and that are currently
being published sorted by Project ID
18. BI Publisher – Create DM – Create LOV’s
SQL to retrieve the list of Activity Codes with a
scope of Global sorted by Activity Code name
19. BI Publisher – Create DM - Parameter
Next, create two (2) parameters
• 1 for Projects and
• 1 for Activity Codes
20. BI Publisher – Create DM – Create Parameter
“p_project_id” is special
parameter recognized by P6
When “Parameter Type” is Menu, a “LOV”
can be selected.
For our example, when the user runs the
report, they can only select 1 project
21. BI Publisher – Create DM – Create Parameter
“p_activitycodetype is NOT is special
parameter recognized by P6
When “Parameter Type” is Menu, a “LOV” can be selected.
For our example, when the user runs the report, they can
only select 1 activity code
22. BI Publisher – Create DM – Data Sets
• Next, create the Data Sets
• Data Sets contain the SQL query/statements to extract the P6 data (such as the
projects data date and an activity’s baseline planned labor units) from the P6 tables
• In our example, we will create four (4) data sets which will be joined together
• In general, our data sets will sum and group activities using the activity code value
assigned to the activity (using the activity code selected)
23. BI Publisher – Create DM – Data Sets
4 Data Sets
• Totals Data Set (DS/G_1) – the result will be 1 record containing project level
data. In addition, this DS will determine the first Monday prior to the start of the
project (for titles on the report and for determining durations for number of bars)
• Chart Dates DS (G_3) – the result will be 1 record with 14 columns (14 columns
for 14 weeks for the bars). Each column will contain the date for the Monday of
that week.
• IndividualBars DS (G_2) – the result will be 1 record for each activity code value
for the activity code selected. This DS will group and sum activities together by
the activity code value. This DS will also determine the earliest start date and
the latest finish date for all the activities for 1 activity code value.
Continued on next slide
24. BI Publisher – Create DM – Data Sets
4 Data Sets (cont.)
• ActivitySpreadData DS (G_4) – the result will be 1 record for each activity code
value. This DS will determine how many baseline planned labor units (and %)
should have been completed by the data date. The results from this DS are
returned to the IndividualBars DS (G_2)
25. BI Publisher – Create DM – Create Data Set
Then select “SQL Query”
26. BI Publisher – Create DM – Create Data Set
More notes on next slide
27. BI Publisher – Create DM – Create Data Set
You could use “Query Builder” for simple SQL
queries/statements.
“Query Builder” builds the SQL query for us.
But for advanced/complex SQL
queries/statements, I just type it in myself
28. BI Publisher – Create DM – Create Data Set
I typed in the SQL
query/statement
29. BI Publisher – Create DM - Data Set / SQL for Totals/G_1
WITH DCGLBVALUES AS
(
-- Get the first Monday before the the earliest start date
-- for the project
-- BASICALLY, we get the earliest date - then
-- substract 7 from that date - then find the Next Monday
SELECT
TRUNC(NEXT_DAY(
TRUNC(
(SELECT
(CASE
WHEN TRUNC(PRJ.SUMBASELINESTARTDATE) < TRUNC(PRJ.STARTDATE) THEN
TRUNC(PRJ.SUMBASELINESTARTDATE)
ELSE
TRUNC(PRJ.STARTDATE)
END
) AS EARLIEST_PHASE_DATE
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
) -7
), 'MONDAY')) AS FIRST_MONDAY FROM DUAL
)
-- END OF DCGLBVALUES
SELECT PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.OBJECTID AS PRJ_OBJECTID,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_PLANNEDLABORUNITS,
PRJ.SUMEARNEDVALUEBYLABORUNITS AS PRJ_EARNEDVALUELABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_REMAININGLABORUNITS,
PRJ.SUMBASELINESTARTDATE AS PRJ_BLSTARTDATE,
PRJ.SUMBASELINEFINISHDATE AS PRJ_BLFINISHDATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.LASTPUBLISHEDON AS PRJ_LASTPUBLISHEDON,
DECODE( NVL(PRJ.SUMPLANNEDLABORUNITS,0), 0, 0,
PRJ.SUMEARNEDVALUEBYLABORUNITS / PRJ.SUMPLANNEDLABORUNITS ) AS PRJ_P_EV,
-- Get dates for each monday up to 12 mondays
( SELECT FIRST_MONDAY FROM DCGLBVALUES) AS FIRST_MONDAY,
-- Data Date offset
(CASE
WHEN (TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )) >= 0 THEN
TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )
ELSE
0
END) AS PRJ_DATADATE_OFFSET,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(PRJ.SUMBASELINESTARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLSTARTDATE_OFFSET,
TRUNC(PRJ.SUMBASELINEFINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLFINISHDATE_OFFSET,
TRUNC(PRJ.STARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_STARTDATE_OFFSET,
TRUNC(PRJ.FINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(PRJ.SUMBASELINEFINISHDATE) - TRUNC(PRJ.SUMBASELINESTARTDATE) AS PRJ_BLDATE_DURATION,
TRUNC(PRJ.FINISHDATE) - TRUNC(PRJ.STARTDATE) AS PRJ_DATE_DURATION
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
Totals/G_1 SQL Query
The result from this DS will
be 1 record with the data
elements for the project
selected.
Data elements include the
project name, data date, total
planned labor units, etc.
This DS also determines the
first Monday for the start of
the project’s start date using
the WITH clause.
The details are on following
slides
30. WITH DCGLBVALUES AS
(
-- Get the first Monday before the the earliest start date
-- for the project
-- BASICALLY, we get the earliest date - then
-- substract 7 from that date - then find the Next Monday
SELECT
TRUNC(NEXT_DAY(
TRUNC(
(SELECT
(CASE
WHEN TRUNC(PRJ.SUMBASELINESTARTDATE) < TRUNC(PRJ.STARTDATE) THEN
TRUNC(PRJ.SUMBASELINESTARTDATE)
ELSE
TRUNC(PRJ.STARTDATE)
END
) AS EARLIEST_PHASE_DATE
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
) -7
), 'MONDAY')) AS FIRST_MONDAY FROM DUAL
)
-- END OF DCGLBVALUES
SELECT PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.OBJECTID AS PRJ_OBJECTID,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_PLANNEDLABORUNITS,
PRJ.SUMEARNEDVALUEBYLABORUNITS AS PRJ_EARNEDVALUELABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_REMAININGLABORUNITS,
PRJ.SUMBASELINESTARTDATE AS PRJ_BLSTARTDATE,
PRJ.SUMBASELINEFINISHDATE AS PRJ_BLFINISHDATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.LASTPUBLISHEDON AS PRJ_LASTPUBLISHEDON,
DECODE( NVL(PRJ.SUMPLANNEDLABORUNITS,0), 0, 0,
PRJ.SUMEARNEDVALUEBYLABORUNITS / PRJ.SUMPLANNEDLABORUNITS ) AS PRJ_P_EV,
-- Get dates for each monday up to 12 mondays
( SELECT FIRST_MONDAY FROM DCGLBVALUES) AS FIRST_MONDAY,
-- Data Date offset
(CASE
WHEN (TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )) >= 0 THEN
TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )
ELSE
0
END) AS PRJ_DATADATE_OFFSET,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(PRJ.SUMBASELINESTARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLSTARTDATE_OFFSET,
TRUNC(PRJ.SUMBASELINEFINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLFINISHDATE_OFFSET,
TRUNC(PRJ.STARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_STARTDATE_OFFSET,
TRUNC(PRJ.FINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(PRJ.SUMBASELINEFINISHDATE) - TRUNC(PRJ.SUMBASELINESTARTDATE) AS PRJ_BLDATE_DURATION,
TRUNC(PRJ.FINISHDATE) - TRUNC(PRJ.STARTDATE) AS PRJ_DATE_DURATION
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
BI Publisher – Create DM - Data Set / SQL for Totals/G_1
Totals/G_1 SQL Query
WITH clause section will be reviewed on
next slide
31. BI Publisher – Create DM - Data Set / SQL for Totals/G_1
WITH DCGLBVALUES AS
(
-- Get the first Monday before the earliest start date
-- for the project
-- BASICALLY, we get the earliest date - then
-- subtract 7 from that date - then find the Next
Monday
SELECT
TRUNC(NEXT_DAY(
TRUNC(
(SELECT
(CASE
WHEN TRUNC(PRJ.SUMBASELINESTARTDATE) <
TRUNC(PRJ.STARTDATE) THEN
TRUNC(PRJ.SUMBASELINESTARTDATE)
ELSE
TRUNC(PRJ.STARTDATE)
END
) AS EARLIEST_PHASE_DATE
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
) -7
), 'MONDAY')) AS FIRST_MONDAY FROM DUAL
)
-- END OF DCGLBVALUES
First_Monday
The With clause will return the results of the SQL
in DCGLBVALUES.
The results of DCGLBVALUES are used in the next
section of the data set
32. BI Publisher – Create DM - Data Set / SQL for Totals/G_1
Totals/G_1 SQL Query
The SELECT statement extracts data from
P6Project and DCGLBVALUES.
In the next few slides, this SELECT
statement will be dissected.
WITH DCGLBVALUES AS
(
-- Get the first Monday before the the earliest start date
-- for the project
-- BASICALLY, we get the earliest date - then
-- substract 7 from that date - then find the Next Monday
SELECT
TRUNC(NEXT_DAY(
TRUNC(
(SELECT
(CASE
WHEN TRUNC(PRJ.SUMBASELINESTARTDATE) < TRUNC(PRJ.STARTDATE) THEN
TRUNC(PRJ.SUMBASELINESTARTDATE)
ELSE
TRUNC(PRJ.STARTDATE)
END
) AS EARLIEST_PHASE_DATE
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
) -7
), 'MONDAY')) AS FIRST_MONDAY FROM DUAL
)
-- END OF DCGLBVALUES
SELECT PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.OBJECTID AS PRJ_OBJECTID,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_PLANNEDLABORUNITS,
PRJ.SUMEARNEDVALUEBYLABORUNITS AS PRJ_EARNEDVALUELABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_REMAININGLABORUNITS,
PRJ.SUMBASELINESTARTDATE AS PRJ_BLSTARTDATE,
PRJ.SUMBASELINEFINISHDATE AS PRJ_BLFINISHDATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.LASTPUBLISHEDON AS PRJ_LASTPUBLISHEDON,
DECODE( NVL(PRJ.SUMPLANNEDLABORUNITS,0), 0, 0,
PRJ.SUMEARNEDVALUEBYLABORUNITS / PRJ.SUMPLANNEDLABORUNITS ) AS PRJ_P_EV,
-- Get dates for each monday up to 12 mondays
( SELECT FIRST_MONDAY FROM DCGLBVALUES) AS FIRST_MONDAY,
-- Data Date offset
(CASE
WHEN (TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )) >= 0 THEN
TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )
ELSE
0
END) AS PRJ_DATADATE_OFFSET,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(PRJ.SUMBASELINESTARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLSTARTDATE_OFFSET,
TRUNC(PRJ.SUMBASELINEFINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLFINISHDATE_OFFSET,
TRUNC(PRJ.STARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_STARTDATE_OFFSET,
TRUNC(PRJ.FINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(PRJ.SUMBASELINEFINISHDATE) - TRUNC(PRJ.SUMBASELINESTARTDATE) AS PRJ_BLDATE_DURATION,
TRUNC(PRJ.FINISHDATE) - TRUNC(PRJ.STARTDATE) AS PRJ_DATE_DURATION
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
33. BI Publisher – Create DM - Data Set / SQL for Totals/G_1
SELECT PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.OBJECTID AS PRJ_OBJECTID,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_PLANNEDLABORUNITS,
PRJ.SUMEARNEDVALUEBYLABORUNITS AS PRJ_EARNEDVALUELABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_REMAININGLABORUNITS,
PRJ.SUMBASELINESTARTDATE AS PRJ_BLSTARTDATE,
PRJ.SUMBASELINEFINISHDATE AS PRJ_BLFINISHDATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.LASTPUBLISHEDON AS PRJ_LASTPUBLISHEDON,
DECODE( NVL(PRJ.SUMPLANNEDLABORUNITS,0), 0, 0,
PRJ.SUMEARNEDVALUEBYLABORUNITS / PRJ.SUMPLANNEDLABORUNITS ) AS PRJ_P_EV,
-- Get dates for each Monday up to 12 Mondays
( SELECT FIRST_MONDAY FROM DCGLBVALUES) AS FIRST_MONDAY,
-- Data Date offset
(CASE
WHEN (TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )) >= 0 THEN
TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )
ELSE
0
END) AS PRJ_DATADATE_OFFSET,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(PRJ.SUMBASELINESTARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLSTARTDATE_OFFSET,
TRUNC(PRJ.SUMBASELINEFINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLFINISHDATE_OFFSET,
TRUNC(PRJ.STARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_STARTDATE_OFFSET,
TRUNC(PRJ.FINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(PRJ.SUMBASELINEFINISHDATE) - TRUNC(PRJ.SUMBASELINESTARTDATE) AS PRJ_BLDATE_DURATION,
TRUNC(PRJ.FINISHDATE) - TRUNC(PRJ.STARTDATE) AS PRJ_DATE_DURATION
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
Read the project’s data from P6Project for only
the project id that was selected.
To use the value in a parameter, prefix the
parameter name with “:”
34. BI Publisher – Create DM - Data Set / SQL for Totals/G_1
SELECT PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.OBJECTID AS PRJ_OBJECTID,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_PLANNEDLABORUNITS,
PRJ.SUMEARNEDVALUEBYLABORUNITS AS PRJ_EARNEDVALUELABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_REMAININGLABORUNITS,
PRJ.SUMBASELINESTARTDATE AS PRJ_BLSTARTDATE,
PRJ.SUMBASELINEFINISHDATE AS PRJ_BLFINISHDATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.LASTPUBLISHEDON AS PRJ_LASTPUBLISHEDON,
Here we are pulling in standard data elements
from the P6Project table.
Some of these data elements (such as Project
Name/PRJ_NAME and Last Published
On/PRJ_LASTPUBLISHEDON) will be used
directly on the report.
35. BI Publisher – Create DM - Data Set / SQL for Totals/G_1
SELECT PRJ.ID AS PRJ_ID,
PRJ.NAME AS PRJ_NAME,
PRJ.OBJECTID AS PRJ_OBJECTID,
PRJ.DATADATE AS PRJ_DATADATE,
PRJ.SUMPLANNEDLABORUNITS AS PRJ_PLANNEDLABORUNITS,
PRJ.SUMEARNEDVALUEBYLABORUNITS AS PRJ_EARNEDVALUELABORUNITS,
PRJ.SUMREMAININGLABORUNITS AS PRJ_REMAININGLABORUNITS,
PRJ.SUMBASELINESTARTDATE AS PRJ_BLSTARTDATE,
PRJ.SUMBASELINEFINISHDATE AS PRJ_BLFINISHDATE,
PRJ.STARTDATE AS PRJ_STARTDATE,
PRJ.FINISHDATE AS PRJ_FINISHDATE,
PRJ.LASTPUBLISHEDON AS PRJ_LASTPUBLISHEDON,
DECODE( NVL(PRJ.SUMPLANNEDLABORUNITS,0), 0, 0,
PRJ.SUMEARNEDVALUEBYLABORUNITS / PRJ.SUMPLANNEDLABORUNITS ) AS PRJ_P_EV,
-- Get dates for each Monday up to 12 Mondays
( SELECT FIRST_MONDAY FROM DCGLBVALUES) AS FIRST_MONDAY,
-- Data Date offset
(CASE
WHEN (TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )) >= 0 THEN
TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )
ELSE
0
END) AS PRJ_DATADATE_OFFSET,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(PRJ.SUMBASELINESTARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLSTARTDATE_OFFSET,
TRUNC(PRJ.SUMBASELINEFINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLFINISHDATE_OFFSET,
TRUNC(PRJ.STARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_STARTDATE_OFFSET,
TRUNC(PRJ.FINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(PRJ.SUMBASELINEFINISHDATE) - TRUNC(PRJ.SUMBASELINESTARTDATE) AS PRJ_BLDATE_DURATION,
TRUNC(PRJ.FINISHDATE) - TRUNC(PRJ.STARTDATE) AS PRJ_DATE_DURATION
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
Here we are calculating the percentage of Earned Value and
storing it into a data element called PRJ_P_EV.
Before we divide by PRJ.SUMPLANNEDLABORUNITS, we check
PRJ.SUMPLANNEDLABORUNITS to make sure it is not ZERO by
using the DECODE function.
The DECODE function will compare the 1st argument with the
2nd argument – and if the 1st and 2nd arguments are equal, the
3rd argument is returned (which is 0) otherwise the 4th argument
is returned (which is the result of the division statement) into
PRJ_P_EV.
36. BI Publisher – Create DM - Data Set / SQL for Totals/G_1
DECODE( NVL(PRJ.SUMPLANNEDLABORUNITS,0), 0, 0,
PRJ.SUMEARNEDVALUEBYLABORUNITS / PRJ.SUMPLANNEDLABORUNITS ) AS PRJ_P_EV,
-- Get dates for each Monday up to 12 Mondays
( SELECT FIRST_MONDAY FROM DCGLBVALUES) AS FIRST_MONDAY,
-- Data Date offset
(CASE
WHEN (TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )) >= 0 THEN
TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )
ELSE
0
END) AS PRJ_DATADATE_OFFSET,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(PRJ.SUMBASELINESTARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLSTARTDATE_OFFSET,
TRUNC(PRJ.SUMBASELINEFINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLFINISHDATE_OFFSET,
TRUNC(PRJ.STARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_STARTDATE_OFFSET,
TRUNC(PRJ.FINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(PRJ.SUMBASELINEFINISHDATE) - TRUNC(PRJ.SUMBASELINESTARTDATE) AS PRJ_BLDATE_DURATION,
TRUNC(PRJ.FINISHDATE) - TRUNC(PRJ.STARTDATE) AS PRJ_DATE_DURATION
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
Here we get the FIRST_MONDAY value from the
results of the WITH clause.
The WITH clause results are stored in
DCGLBVALUES (which looks just like a table to
other SQL statements referencing
DCGLBVALUES.
In other data sets (such as CHART_DATES), the
data element FIRST_MONDAY is referenced.
NOTE: The WITH clause may not work with all
versions of BIP. In those situations, you need to
replace DCGLBVALUES with the SELECT
statement within the WITH clause.
37. BI Publisher – Create DM - Data Set / SQL for Totals/G_1
( SELECT FIRST_MONDAY FROM DCGLBVALUES) AS FIRST_MONDAY,
-- Data Date offset
(CASE
WHEN (TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )) >= 0 THEN
TRUNC(PRJ.DATADATE) -
TRUNC( (SELECT FIRST_MONDAY FROM DCGLBVALUES) )
ELSE
0
END) AS PRJ_DATADATE_OFFSET,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(PRJ.SUMBASELINESTARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLSTARTDATE_OFFSET,
TRUNC(PRJ.SUMBASELINEFINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_BLFINISHDATE_OFFSET,
TRUNC(PRJ.STARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_STARTDATE_OFFSET,
TRUNC(PRJ.FINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES)) AS PRJ_FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(PRJ.SUMBASELINEFINISHDATE) - TRUNC(PRJ.SUMBASELINESTARTDATE) AS PRJ_BLDATE_DURATION,
TRUNC(PRJ.FINISHDATE) - TRUNC(PRJ.STARTDATE) AS PRJ_DATE_DURATION
FROM P6PROJECT PRJ
WHERE PRJ.ID = :p_project_id
At one point, we were going to add a vertical bar to the Bar Chart Report using the data date
however the presentation was becoming too complicated for an hour presentation.
So ‐ we kept the value but did not use it on the Bar Chart Report.
NOTE: When building the bars on the bar chart section of the report, we need offset values
from the beginning of the graph and durations in numeric format. We cannot use dates
directly for the begin and end points on the bars. Therefore, we use the FIRST_MONDAY as the
starting point of the chart.
PRJ.DATADATE – FIRST_MONDAY will give us the number of days from the first Monday (which
is the beginning of the chart).
The CASE statement is similar to an IF‐THEN‐ELSE clause. If the difference of DATADATE –
FIRST_MONDAY is positive, use it otherwise return 0.
The TRUNC() function is used to drop hours and minutes from the date/time value.
38. BI Publisher – Create DM - Data Set / SQL for Totals/G_1
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(PRJ.SUMBASELINESTARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES))
AS PRJ_BLSTARTDATE_OFFSET,
TRUNC(PRJ.SUMBASELINEFINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES))
AS PRJ_BLFINISHDATE_OFFSET,
TRUNC(PRJ.STARTDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES))
AS PRJ_STARTDATE_OFFSET,
TRUNC(PRJ.FINISHDATE) -
TRUNC((SELECT FIRST_MONDAY FROM DCGLBVALUES))
AS PRJ_FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(PRJ.SUMBASELINEFINISHDATE) - TRUNC(PRJ.SUMBASELINESTARTDATE)
AS PRJ_BLDATE_DURATION,
TRUNC(PRJ.FINISHDATE) - TRUNC(PRJ.STARTDATE)
AS PRJ_DATE_DURATION
Here we are calculating the offset and/or durations for the bars on the bar chart using FIRST_MONDAY as the
starting point of the chart.
NOTE: When building the bars on the bar chart section of the report, we need offset values from the beginning of
the graph and durations in numeric format. We cannot use dates directly for the begin and end points on the bars.
Therefore, we use the FIRST_MONDAY as the starting point of the chart.
Also NOTE: The SQL statement (SELECT FIRST_MONDAY FROM DCGLBVALUES) returns FIRST_MONDAY.
39. BI Publisher – Create DM - Data Set / SQL for Totals/G_1
That was the end of the SQL for Totals/G_1
Now, we will dissect SQL for IndivdualBars/G_2
40. BI Publisher – Create DM - Data Set / SQL for IndivdualBars/G_2
WITH DCINDIVIDUALBARS AS
(
SELECT ACTCODE.ACTIVITYCODEVALUE AS ACTCODEVALUE,
SUM(NVL(ACT.BASELINEPLANNEDLABORUNITS,0)) AS SUM_BLPLANNEDLABORUNITS,
SUM(NVL(ACT.PLANNEDLABORUNITS,0)) AS SUM_PLANNEDLABORUNITS,
SUM(NVL(ACT.EARNEDVALUELABORUNITS,0)) AS SUM_EARNEDVALUELABORUNITS,
SUM(NVL(ACT.REMAININGLABORUNITS,0)) AS SUM_REMAININGLABORUNITS,
MIN(ACT.BASELINESTARTDATE) AS BLSTARTDATE,
MAX(ACT.BASELINEFINISHDATE) AS BLFINISHDATE,
MIN(ACT.STARTDATE) AS STARTDATE,
MAX(ACT.FINISHDATE) AS FINISHDATE
FROM P6PROJECT PRJ,
P6ACTIVITY ACT,
P6ACTIVITYCODEASSIGNMENT ACTCODE
WHERE PRJ.OBJECTID = :PRJ_OBJECTID AND
PRJ.OBJECTID = ACT.PROJECTOBJECTID AND
ACT.OBJECTID = ACTCODE.ACTIVITYOBJECTID AND
ACTCODE.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTCODE.ACTIVITYCODETYPESCOPE = 'AS_Global'
GROUP BY ACTCODE.ACTIVITYCODEVALUE
ORDER BY ACTCODE.ACTIVITYCODEVALUE
)
-- END OF DCINDIVIDUALBARS
-- Offsets from starting date of bar chart
--:FIRST_MONDAY - MIN() AS ACT.BASELINESTARTDATE
SELECT ACTCODEVALUE,
SUM_BLPLANNEDLABORUNITS,
SUM_PLANNEDLABORUNITS,
SUM_EARNEDVALUELABORUNITS,
--
DECODE( SUM_PLANNEDLABORUNITS, 0, 0,
SUM_EARNEDVALUELABORUNITS / SUM_PLANNEDLABORUNITS ) AS
P_EV,
SUM_REMAININGLABORUNITS,
BLSTARTDATE,
BLFINISHDATE,
STARTDATE,
FINISHDATE,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(BLSTARTDATE) - TRUNC(:FIRST_MONDAY) AS BLSTARTDATE_OFFSET,
TRUNC(BLFINISHDATE) - TRUNC(:FIRST_MONDAY) AS BLFINISHDATE_OFFSET,
TRUNC(STARTDATE) - TRUNC(:FIRST_MONDAY) AS STARTDATE_OFFSET,
TRUNC(FINISHDATE) - TRUNC(:FIRST_MONDAY) AS FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(BLFINISHDATE) - TRUNC(BLSTARTDATE) AS BLDATE_DURATION,
TRUNC(FINISHDATE) - TRUNC(STARTDATE) AS DATE_DURATION
FROM DCINDIVIDUALBARS
IndividualBars/G_2 SQL Query
The result from this DS will be 1 record for each
activity code value for the activity code selected
when the user runs the report.
In the DS, we use the WITH clause to group and
sum all activities with the same Activity Code
Value. Then we use the results from the WITH
clause in the SELECT statement. The primary
reason for using the WITH clause is to simplify
the SQL.
The details on following slides
41. BI Publisher – Create DM - Data Set / SQL for IndivdualBars/G_2
WITH DCINDIVIDUALBARS AS
(
SELECT ACTCODE.ACTIVITYCODEVALUE AS ACTCODEVALUE,
SUM(NVL(ACT.BASELINEPLANNEDLABORUNITS,0)) AS SUM_BLPLANNEDLABORUNITS,
SUM(NVL(ACT.PLANNEDLABORUNITS,0)) AS SUM_PLANNEDLABORUNITS,
SUM(NVL(ACT.EARNEDVALUELABORUNITS,0)) AS SUM_EARNEDVALUELABORUNITS,
SUM(NVL(ACT.REMAININGLABORUNITS,0)) AS SUM_REMAININGLABORUNITS,
MIN(ACT.BASELINESTARTDATE) AS BLSTARTDATE,
MAX(ACT.BASELINEFINISHDATE) AS BLFINISHDATE,
MIN(ACT.STARTDATE) AS STARTDATE,
MAX(ACT.FINISHDATE) AS FINISHDATE
FROM P6PROJECT PRJ,
P6ACTIVITY ACT,
P6ACTIVITYCODEASSIGNMENT ACTCODE
WHERE PRJ.OBJECTID = :PRJ_OBJECTID AND
PRJ.OBJECTID = ACT.PROJECTOBJECTID AND
ACT.OBJECTID = ACTCODE.ACTIVITYOBJECTID AND
ACTCODE.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTCODE.ACTIVITYCODETYPESCOPE = 'AS_Global'
GROUP BY ACTCODE.ACTIVITYCODEVALUE
ORDER BY ACTCODE.ACTIVITYCODEVALUE
)
-- END OF DCINDIVIDUALBARS
IndividualBars/G_2 SQL Query
The WITH clause will be covered
on the next slide
42. BI Publisher – Create DM - Data Set / SQL for IndivdualBars/G_2
WITH DCINDIVIDUALBARS AS
(
SELECT ACTCODE.ACTIVITYCODEVALUE AS ACTCODEVALUE,
SUM(NVL(ACT.BASELINEPLANNEDLABORUNITS,0)) AS SUM_BLPLANNEDLABORUNITS,
SUM(NVL(ACT.PLANNEDLABORUNITS,0)) AS SUM_PLANNEDLABORUNITS,
SUM(NVL(ACT.EARNEDVALUELABORUNITS,0)) AS SUM_EARNEDVALUELABORUNITS,
SUM(NVL(ACT.REMAININGLABORUNITS,0)) AS SUM_REMAININGLABORUNITS,
MIN(ACT.BASELINESTARTDATE) AS BLSTARTDATE,
MAX(ACT.BASELINEFINISHDATE) AS BLFINISHDATE,
MIN(ACT.STARTDATE) AS STARTDATE,
MAX(ACT.FINISHDATE) AS FINISHDATE
FROM P6PROJECT PRJ,
P6ACTIVITY ACT,
P6ACTIVITYCODEASSIGNMENT ACTCODE
WHERE PRJ.OBJECTID = :PRJ_OBJECTID AND
PRJ.OBJECTID = ACT.PROJECTOBJECTID AND
ACT.OBJECTID = ACTCODE.ACTIVITYOBJECTID AND
ACTCODE.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTCODE.ACTIVITYCODETYPESCOPE = 'AS_Global'
GROUP BY ACTCODE.ACTIVITYCODEVALUE
ORDER BY ACTCODE.ACTIVITYCODEVALUE
)
-- END OF DCINDIVIDUALBARS
First we link P6PROJECT table with the P6Activity
table using the parameter :PRJ_OBJECT which
was initialized in the Totals/G_1 DS.
Next, we link the P6ACTIVITY table with the
P6ACTIVITYASSIGNMENT table
Then we tell the SQL to only return
activities that has been assigned an Activity
Code (with a scope of GLOBAL) that is
equal to the one selected when the user
ran the report.
43. BI Publisher – Create DM - Data Set / SQL for IndivdualBars/G_2
WITH DCINDIVIDUALBARS AS
(
SELECT ACTCODE.ACTIVITYCODEVALUE AS ACTCODEVALUE,
SUM(NVL(ACT.BASELINEPLANNEDLABORUNITS,0)) AS SUM_BLPLANNEDLABORUNITS,
SUM(NVL(ACT.PLANNEDLABORUNITS,0)) AS SUM_PLANNEDLABORUNITS,
SUM(NVL(ACT.EARNEDVALUELABORUNITS,0)) AS SUM_EARNEDVALUELABORUNITS,
SUM(NVL(ACT.REMAININGLABORUNITS,0)) AS SUM_REMAININGLABORUNITS,
MIN(ACT.BASELINESTARTDATE) AS BLSTARTDATE,
MAX(ACT.BASELINEFINISHDATE) AS BLFINISHDATE,
MIN(ACT.STARTDATE) AS STARTDATE,
MAX(ACT.FINISHDATE) AS FINISHDATE
FROM P6PROJECT PRJ,
P6ACTIVITY ACT,
P6ACTIVITYCODEASSIGNMENT ACTCODE
WHERE PRJ.OBJECTID = :PRJ_OBJECTID AND
PRJ.OBJECTID = ACT.PROJECTOBJECTID AND
ACT.OBJECTID = ACTCODE.ACTIVITYOBJECTID AND
ACTCODE.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTCODE.ACTIVITYCODETYPESCOPE = 'AS_Global'
GROUP BY ACTCODE.ACTIVITYCODEVALUE
ORDER BY ACTCODE.ACTIVITYCODEVALUE
)
-- END OF DCINDIVIDUALBARS
Next, we group together the activities with
the same Activity Code Value (such as ELEC
for the Activity Code of Team)
The SUM(), MIN(), and MAX() functions
above key off of the GROUP BY clause.
44. BI Publisher – Create DM - Data Set / SQL for IndivdualBars/G_2
WITH DCINDIVIDUALBARS AS
(
SELECT ACTCODE.ACTIVITYCODEVALUE AS ACTCODEVALUE,
SUM(NVL(ACT.BASELINEPLANNEDLABORUNITS,0)) AS SUM_BLPLANNEDLABORUNITS,
SUM(NVL(ACT.PLANNEDLABORUNITS,0)) AS SUM_PLANNEDLABORUNITS,
SUM(NVL(ACT.EARNEDVALUELABORUNITS,0)) AS SUM_EARNEDVALUELABORUNITS,
SUM(NVL(ACT.REMAININGLABORUNITS,0)) AS SUM_REMAININGLABORUNITS,
MIN(ACT.BASELINESTARTDATE) AS BLSTARTDATE,
MAX(ACT.BASELINEFINISHDATE) AS BLFINISHDATE,
MIN(ACT.STARTDATE) AS STARTDATE,
MAX(ACT.FINISHDATE) AS FINISHDATE
FROM P6PROJECT PRJ,
P6ACTIVITY ACT,
P6ACTIVITYCODEASSIGNMENT ACTCODE
WHERE PRJ.OBJECTID = :PRJ_OBJECTID AND
PRJ.OBJECTID = ACT.PROJECTOBJECTID AND
ACT.OBJECTID = ACTCODE.ACTIVITYOBJECTID AND
ACTCODE.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTCODE.ACTIVITYCODETYPESCOPE = 'AS_Global'
GROUP BY ACTCODE.ACTIVITYCODEVALUE
ORDER BY ACTCODE.ACTIVITYCODEVALUE
)
-- END OF DCINDIVIDUALBARS
For all activities with the same Activity Code
Value (such as ELEC for the Activity Code of
Team), the following data elements are
summed:
1. BASELINEPLANNEDLABORUNITS,
2. PLANNEDLABORUNITS,
3. EARNEDVALUELABORUNITS, and
4. REMAININGLABORUNITS
45. BI Publisher – Create DM - Data Set / SQL for IndivdualBars/G_2
WITH DCINDIVIDUALBARS AS
(
SELECT ACTCODE.ACTIVITYCODEVALUE AS ACTCODEVALUE,
SUM(NVL(ACT.BASELINEPLANNEDLABORUNITS,0)) AS SUM_BLPLANNEDLABORUNITS,
SUM(NVL(ACT.PLANNEDLABORUNITS,0)) AS SUM_PLANNEDLABORUNITS,
SUM(NVL(ACT.EARNEDVALUELABORUNITS,0)) AS SUM_EARNEDVALUELABORUNITS,
SUM(NVL(ACT.REMAININGLABORUNITS,0)) AS SUM_REMAININGLABORUNITS,
MIN(ACT.BASELINESTARTDATE) AS BLSTARTDATE,
MAX(ACT.BASELINEFINISHDATE) AS BLFINISHDATE,
MIN(ACT.STARTDATE) AS STARTDATE,
MAX(ACT.FINISHDATE) AS FINISHDATE
FROM P6PROJECT PRJ,
P6ACTIVITY ACT,
P6ACTIVITYCODEASSIGNMENT ACTCODE
WHERE PRJ.OBJECTID = :PRJ_OBJECTID AND
PRJ.OBJECTID = ACT.PROJECTOBJECTID AND
ACT.OBJECTID = ACTCODE.ACTIVITYOBJECTID AND
ACTCODE.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTCODE.ACTIVITYCODETYPESCOPE = 'AS_Global'
GROUP BY ACTCODE.ACTIVITYCODEVALUE
ORDER BY ACTCODE.ACTIVITYCODEVALUE
)
-- END OF DCINDIVIDUALBARS
In addition, for all activities with the same
Activity Code Value (such as ELEC for the
Activity Code of Team), the earliest start dates
and the latest finish dates are determined by
using the MIN() and MAX() functions
46. BI Publisher – Create DM - Data Set / SQL for IndivdualBars/G_2
WITH DCINDIVIDUALBARS AS
(
SELECT ACTCODE.ACTIVITYCODEVALUE AS ACTCODEVALUE,
SUM(NVL(ACT.BASELINEPLANNEDLABORUNITS,0)) AS SUM_BLPLANNEDLABORUNITS,
SUM(NVL(ACT.PLANNEDLABORUNITS,0)) AS SUM_PLANNEDLABORUNITS,
SUM(NVL(ACT.EARNEDVALUELABORUNITS,0)) AS SUM_EARNEDVALUELABORUNITS,
SUM(NVL(ACT.REMAININGLABORUNITS,0)) AS SUM_REMAININGLABORUNITS,
MIN(ACT.BASELINESTARTDATE) AS BLSTARTDATE,
MAX(ACT.BASELINEFINISHDATE) AS BLFINISHDATE,
MIN(ACT.STARTDATE) AS STARTDATE,
MAX(ACT.FINISHDATE) AS FINISHDATE
FROM P6PROJECT PRJ,
P6ACTIVITY ACT,
P6ACTIVITYCODEASSIGNMENT ACTCODE
WHERE PRJ.OBJECTID = :PRJ_OBJECTID AND
PRJ.OBJECTID = ACT.PROJECTOBJECTID AND
ACT.OBJECTID = ACTCODE.ACTIVITYOBJECTID AND
ACTCODE.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTCODE.ACTIVITYCODETYPESCOPE = 'AS_Global'
GROUP BY ACTCODE.ACTIVITYCODEVALUE
ORDER BY ACTCODE.ACTIVITYCODEVALUE
)
-- END OF DCINDIVIDUALBARS
-- Offsets from starting date of bar chart
--:FIRST_MONDAY - MIN() AS ACT.BASELINESTARTDATE
SELECT ACTCODEVALUE,
SUM_BLPLANNEDLABORUNITS,
SUM_PLANNEDLABORUNITS,
SUM_EARNEDVALUELABORUNITS,
--
DECODE( SUM_PLANNEDLABORUNITS, 0, 0,
SUM_EARNEDVALUELABORUNITS / SUM_PLANNEDLABORUNITS ) AS
P_EV,
SUM_REMAININGLABORUNITS,
BLSTARTDATE,
BLFINISHDATE,
STARTDATE,
FINISHDATE,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(BLSTARTDATE) - TRUNC(:FIRST_MONDAY) AS BLSTARTDATE_OFFSET,
TRUNC(BLFINISHDATE) - TRUNC(:FIRST_MONDAY) AS BLFINISHDATE_OFFSET,
TRUNC(STARTDATE) - TRUNC(:FIRST_MONDAY) AS STARTDATE_OFFSET,
TRUNC(FINISHDATE) - TRUNC(:FIRST_MONDAY) AS FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(BLFINISHDATE) - TRUNC(BLSTARTDATE) AS BLDATE_DURATION,
TRUNC(FINISHDATE) - TRUNC(STARTDATE) AS DATE_DURATION
FROM DCINDIVIDUALBARS
IndividualBars/G_2 SQL Query
Now, we will dissect the second
section of the SQL
The details on following slides
47. BI Publisher – Create DM - Data Set / SQL for IndivdualBars/G_2
-- Offsets from starting date of bar chart
--:FIRST_MONDAY - MIN() AS ACT.BASELINESTARTDATE
SELECT ACTCODEVALUE,
SUM_BLPLANNEDLABORUNITS,
SUM_PLANNEDLABORUNITS,
SUM_EARNEDVALUELABORUNITS,
--
DECODE( SUM_PLANNEDLABORUNITS, 0, 0,
SUM_EARNEDVALUELABORUNITS / SUM_PLANNEDLABORUNITS ) AS P_EV,
SUM_REMAININGLABORUNITS,
BLSTARTDATE,
BLFINISHDATE,
STARTDATE,
FINISHDATE,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(BLSTARTDATE) - TRUNC(:FIRST_MONDAY) AS BLSTARTDATE_OFFSET,
TRUNC(BLFINISHDATE) - TRUNC(:FIRST_MONDAY) AS BLFINISHDATE_OFFSET,
TRUNC(STARTDATE) - TRUNC(:FIRST_MONDAY) AS STARTDATE_OFFSET,
TRUNC(FINISHDATE) - TRUNC(:FIRST_MONDAY) AS FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(BLFINISHDATE) - TRUNC(BLSTARTDATE) AS BLDATE_DURATION,
TRUNC(FINISHDATE) - TRUNC(STARTDATE) AS DATE_DURATION
FROM DCINDIVIDUALBARS
IndividualBars/G_2 SQL Query
The SELECT statement uses the results from
DCINDIVIDUALSBARS (the WITH clause)
See next slide for details
48. BI Publisher – Create DM - Data Set / SQL for IndivdualBars/G_2
SELECT ACTCODEVALUE,
SUM_BLPLANNEDLABORUNITS,
SUM_PLANNEDLABORUNITS,
SUM_EARNEDVALUELABORUNITS,
DECODE( SUM_PLANNEDLABORUNITS, 0, 0,
SUM_EARNEDVALUELABORUNITS / SUM_PLANNEDLABORUNITS ) AS P_EV,
SUM_REMAININGLABORUNITS,
BLSTARTDATE,
BLFINISHDATE,
STARTDATE,
FINISHDATE,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(BLSTARTDATE) - TRUNC(:FIRST_MONDAY) AS BLSTARTDATE_OFFSET,
TRUNC(BLFINISHDATE) - TRUNC(:FIRST_MONDAY) AS BLFINISHDATE_OFFSET,
TRUNC(STARTDATE) - TRUNC(:FIRST_MONDAY) AS STARTDATE_OFFSET,
TRUNC(FINISHDATE) - TRUNC(:FIRST_MONDAY) AS FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(BLFINISHDATE) - TRUNC(BLSTARTDATE) AS BLDATE_DURATION,
TRUNC(FINISHDATE) - TRUNC(STARTDATE) AS DATE_DURATION
FROM DCINDIVIDUALBARS
These values come directly from
DCINDIVIDUALBARS
This is the percentage of Earned Value for all
activities for a specific Activity Code Value.
This value will be used to create the RED bar
on the chart.
49. BI Publisher – Create DM - Data Set / SQL for IndivdualBars/G_2
SELECT ACTCODEVALUE,
SUM_BLPLANNEDLABORUNITS,
SUM_PLANNEDLABORUNITS,
SUM_EARNEDVALUELABORUNITS,
--
DECODE( SUM_PLANNEDLABORUNITS, 0, 0,
SUM_EARNEDVALUELABORUNITS / SUM_PLANNEDLABORUNITS ) AS P_EV,
SUM_REMAININGLABORUNITS,
BLSTARTDATE,
BLFINISHDATE,
STARTDATE,
FINISHDATE,
-- Now, determine offsets from First Monday for each
-- Date
TRUNC(BLSTARTDATE) - TRUNC(:FIRST_MONDAY) AS BLSTARTDATE_OFFSET,
TRUNC(BLFINISHDATE) - TRUNC(:FIRST_MONDAY) AS BLFINISHDATE_OFFSET,
TRUNC(STARTDATE) - TRUNC(:FIRST_MONDAY) AS STARTDATE_OFFSET,
TRUNC(FINISHDATE) - TRUNC(:FIRST_MONDAY) AS FINISHDATE_OFFSET,
-- Now, determine durations for BL dates and Start/Finish dates
TRUNC(BLFINISHDATE) - TRUNC(BLSTARTDATE) AS BLDATE_DURATION,
TRUNC(FINISHDATE) - TRUNC(STARTDATE) AS DATE_DURATION
FROM DCINDIVIDUALBARS
These values come directly from
DCINDIVIDUALBARS
Here we are calculating the offset
and/or durations for the bars on the
bar chart using FIRST_MONDAY as the
starting point of the chart.
50. BI Publisher – Create DM – Data Set / SQL for IndivdualBars/G_2
Totals/G_1 Data Set is “Group Link’ed” to the
IndividualBars/G_2 Data Set.
So, for every record in G_1, the SQL in G_2 is executed
To add a “Group Link”, click on the Action button then
select “Create Group Link”
51. BI Publisher – Create DM - Data Set / SQL for ChartDates/G_3
SELECT TRUNC(:FIRST_MONDAY) AS CHART_DATE1,
TRUNC(:FIRST_MONDAY)+7 AS CHART_DATE2,
TRUNC(:FIRST_MONDAY)+14 AS CHART_DATE3,
TRUNC(:FIRST_MONDAY)+21 AS CHART_DATE4,
TRUNC(:FIRST_MONDAY)+28 AS CHART_DATE5,
TRUNC(:FIRST_MONDAY)+35 AS CHART_DATE6,
TRUNC(:FIRST_MONDAY)+42 AS CHART_DATE7,
TRUNC(:FIRST_MONDAY)+49 AS CHART_DATE8,
TRUNC(:FIRST_MONDAY)+56 AS CHART_DATE9,
TRUNC(:FIRST_MONDAY)+63 AS CHART_DATE10,
TRUNC(:FIRST_MONDAY)+70 AS CHART_DATE11,
TRUNC(:FIRST_MONDAY)+77 AS CHART_DATE12,
TRUNC(:FIRST_MONDAY)+84 AS CHART_DATE13,
TRUNC(:FIRST_MONDAY)+91 AS CHART_DATE14
FROM DUAL
ChartDates/G_3 SQL Query
The result from this DS will
be 1 record with 14
columns/data elements.
Each column is a date
starting with the first
Monday prior to the start of
the project. Each date is a
Monday.
These data elements are
used above the bar chart
52. BI Publisher – Create DM – Data Set / SQL for ChartDates/G_3
Totals/G_1 Data Set is “Group Link’ed” to the ChartDates/G_3 Data Set.
So, for every record in G_1, the SQL in G_3 is executed
53. BI Publisher – Create DM - Data Set / SQL for ActivitySpreadData/G_4
SELECT SUM(NVL(ACTS.BASELINEPLANNEDLABORUNITS,0)) AS ACTS_BLPLANNEDLABORUNITS,
-- DECODE - if :SUM_BLPLANNEDLABORUNITS = 0, return 0 otherwise
-- use :SUM_BLPLANNEDLABORUNITS as divisor
DECODE(:SUM_BLPLANNEDLABORUNITS,0,0,
SUM(NVL(ACTS.BASELINEPLANNEDLABORUNITS,0))/:SUM_BLPLANNEDLABORUNITS )
AS ACTS_P_BLPLANNEDLABORUNITS
FROM P6ACTIVITYSPREAD ACTS,
P6ACTIVITYCODEASSIGNMENT ACTA,
P6ACTIVITY ACT
WHERE ACTS.PROJECTOBJECTID = :PRJ_OBJECTID AND
-- (+) is left join so I can get the data date from act
(ACTS.ACTIVITYOBJECTID = ACT.OBJECTID (+)) AND
TRUNC(ACTS.STARTDATE) <= TRUNC(ACT.DATADATE) AND
ACTS.ACTIVITYOBJECTID = ACTA.ACTIVITYOBJECTID AND
ACTA.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTA.ACTIVITYCODETYPESCOPE = 'AS_Global' AND
ACTA.ACTIVITYCODEVALUE = :ACTCODEVALUE
ActivitySpreadData/G_4 SQL Query
This DS is executed from IndividualBars/G_2 for each Activity Code Value (via a Group Link).
This DS uses a few parameters from other data sets (for example :SUM_BLPLANNEDLABORUNITS and
:ACTCODEVALUE are initialized in IndividualBars/G_2).
This DS sums the total number of baseline planned labor units up to the Data Date for a specific activity code
value. This DS also calculates the percentage of the baseline planned labor units up to the Data Date.
(More comments on next slide)
54. BI Publisher – Create DM - Data Set / SQL for ActivitySpreadData/G_4
SELECT SUM(NVL(ACTS.BASELINEPLANNEDLABORUNITS,0)) AS ACTS_BLPLANNEDLABORUNITS,
-- DECODE - if :SUM_BLPLANNEDLABORUNITS = 0, return 0 otherwise
-- use :SUM_BLPLANNEDLABORUNITS as divisor
DECODE(:SUM_BLPLANNEDLABORUNITS,0,0,
SUM(NVL(ACTS.BASELINEPLANNEDLABORUNITS,0))/:SUM_BLPLANNEDLABORUNITS )
AS ACTS_P_BLPLANNEDLABORUNITS
FROM P6ACTIVITYSPREAD ACTS,
P6ACTIVITYCODEASSIGNMENT ACTA,
P6ACTIVITY ACT
WHERE ACTS.PROJECTOBJECTID = :PRJ_OBJECTID AND
-- (+) is left join so I can get the data date from act
(ACTS.ACTIVITYOBJECTID = ACT.OBJECTID (+)) AND
TRUNC(ACTS.STARTDATE) <= TRUNC(ACT.DATADATE) AND
ACTS.ACTIVITYOBJECTID = ACTA.ACTIVITYOBJECTID AND
ACTA.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTA.ACTIVITYCODETYPESCOPE = 'AS_Global' AND
ACTA.ACTIVITYCODEVALUE = :ACTCODEVALUE
ActivitySpreadData/G_4 SQL Query
The purpose of this DS is to determine how many planned labor units should have been done by the Data
Date.
At one point, we were going to use the results from this DS on the Bar Chart report however the
presentation was becoming too complicated for an hour presentation. BUT these results could be added by
you.
55. BI Publisher – Create DM - Data Set / SQL for ActivitySpreadData/G_4
SELECT SUM(NVL(ACTS.BASELINEPLANNEDLABORUNITS,0)) AS ACTS_BLPLANNEDLABORUNITS,
-- DECODE - if :SUM_BLPLANNEDLABORUNITS = 0, return 0 otherwise
-- use :SUM_BLPLANNEDLABORUNITS as divisor
DECODE(:SUM_BLPLANNEDLABORUNITS,0,0,
SUM(NVL(ACTS.BASELINEPLANNEDLABORUNITS,0))
/:SUM_BLPLANNEDLABORUNITS )
AS ACTS_P_BLPLANNEDLABORUNITS
FROM P6ACTIVITYSPREAD ACTS,
P6ACTIVITYCODEASSIGNMENT ACTA,
P6ACTIVITY ACT
WHERE ACTS.PROJECTOBJECTID = :PRJ_OBJECTID AND
-- (+) is left join so I can get the data date from act
(ACTS.ACTIVITYOBJECTID = ACT.OBJECTID (+)) AND
TRUNC(ACTS.STARTDATE) <= TRUNC(ACT.DATADATE) AND
ACTS.ACTIVITYOBJECTID = ACTA.ACTIVITYOBJECTID AND
ACTA.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTA.ACTIVITYCODETYPESCOPE = 'AS_Global' AND
ACTA.ACTIVITYCODEVALUE = :ACTCODEVALUE
This is a LEFT JOIN using (+) from
the P6ActivityCodeAssignment
table to the P6Activity table so that
the Data Date can be determined.
56. BI Publisher – Create DM - Data Set / SQL for ActivitySpreadData/G_4
SELECT SUM(NVL(ACTS.BASELINEPLANNEDLABORUNITS,0)) AS ACTS_BLPLANNEDLABORUNITS,
-- DECODE - if :SUM_BLPLANNEDLABORUNITS = 0, return 0 otherwise
-- use :SUM_BLPLANNEDLABORUNITS as divisor
DECODE(:SUM_BLPLANNEDLABORUNITS,0,0,
SUM(NVL(ACTS.BASELINEPLANNEDLABORUNITS,0))
/:SUM_BLPLANNEDLABORUNITS )
AS ACTS_P_BLPLANNEDLABORUNITS
FROM P6ACTIVITYSPREAD ACTS,
P6ACTIVITYCODEASSIGNMENT ACTA,
P6ACTIVITY ACT
WHERE ACTS.PROJECTOBJECTID = :PRJ_OBJECTID AND
-- (+) is left join so I can get the data date from act
(ACTS.ACTIVITYOBJECTID = ACT.OBJECTID (+)) AND
TRUNC(ACTS.STARTDATE) <= TRUNC(ACT.DATADATE) AND
ACTS.ACTIVITYOBJECTID = ACTA.ACTIVITYOBJECTID AND
ACTA.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTA.ACTIVITYCODETYPESCOPE = 'AS_Global' AND
ACTA.ACTIVITYCODEVALUE = :ACTCODEVALUE
Here, we only include spread data
where the start date is less than or
equal to the data date
57. BI Publisher – Create DM - Data Set / SQL for ActivitySpreadData/G_4
SELECT SUM(NVL(ACTS.BASELINEPLANNEDLABORUNITS,0)) AS ACTS_BLPLANNEDLABORUNITS,
-- DECODE - if :SUM_BLPLANNEDLABORUNITS = 0, return 0 otherwise
-- use :SUM_BLPLANNEDLABORUNITS as divisor
DECODE(:SUM_BLPLANNEDLABORUNITS,0,0,
SUM(NVL(ACTS.BASELINEPLANNEDLABORUNITS,0))
/:SUM_BLPLANNEDLABORUNITS )
AS ACTS_P_BLPLANNEDLABORUNITS
FROM P6ACTIVITYSPREAD ACTS,
P6ACTIVITYCODEASSIGNMENT ACTA,
P6ACTIVITY ACT
WHERE ACTS.PROJECTOBJECTID = :PRJ_OBJECTID AND
-- (+) is left join so I can get the data date from act
(ACTS.ACTIVITYOBJECTID = ACT.OBJECTID (+)) AND
TRUNC(ACTS.STARTDATE) <= TRUNC(ACT.DATADATE) AND
ACTS.ACTIVITYOBJECTID = ACTA.ACTIVITYOBJECTID AND
ACTA.ACTIVITYCODETYPENAME = :p_activitycodetype AND
ACTA.ACTIVITYCODETYPESCOPE = 'AS_Global' AND
ACTA.ACTIVITYCODEVALUE = :ACTCODEVALUE
Here, we only include spread data where the records
have the right Activity Code Value.
Note: :p_activitycodetype is a parameter that the user
selected and :ACTCODEVALUE is initialized by the DS
that executes this DS
58. BI Publisher – Create DM – Data Set / SQL for ActivitySpreadData/G_4
IndividualBars/G_2 Data Set is “Group Link’ed” to
the ActivitySpreadData/G_4 Data Set.
So, for every record in G_2, the SQL in G_4 is
executed
59. BI Publisher – Create DM – Data Set / SQL for ActivitySpreadData/G_4
To include the data elements from G_4 in
G_2, we need to drag and drop the data
elements from G_4 to the
“Drop here for aggregate function” section.
Then set the properties on the new data
elements.
See next slide
60. BI Publisher – Create DM – Data Set / SQL for ActivitySpreadData/G_4
Select and drag the data element from
G_4 to the
“Drop here for aggregate function”
section.
After the drag and drop, set
the properties on the data
element
61. BI Publisher – Create DM – Create XML Data
• After creating the LOV’s, Parameters, and the Data Set – you must generate XML
data.
• To create the presentation part of the report, you must have XML data
• You must save the XML data to the DM if you are building the report in the Report
Layout Editor
• You must save the XML data to a file and import it into your WORD document if
you are using the Word Template Builder
62. BI Publisher – Create DM – Create XML Data
Here are the four data sets described
on the previous slides
Generate XML Data
Click this button to
show the screen
when we can
generate the XML.
Here are the list of values and parameters
described on the previous slides
63. BI Publisher – Create DM – Create XML Data
1. Generate XML
Data
Select 1 project and
select 1 Activity
Code, then click
“Run”
2. XML Data
The XML data
has the tag
names and
values.
3. Save XML
Either “Export XML” to a
file or “Save As Sample
Data” to the DM.
For our example, we need
to “Export XML” into a file
so that we can import it
into the WORD Template
Builder
64. BI Publisher – Create DM – Create XML Data
• Save the DM
• Next, build presentation part of report by first creating a report called “Bar Chart”
and then
• Use Word Template Builder for layout
66. BI Publisher – Create Report – Select DM
Select DM for the
report then enter a
name for the report
Then save report. We
will call it Barchart
67. BI Publisher – Create Report
Report Layout Editor
If we were going to create the presentation
part in the Report Layout Editor tool, then I
would have selected a Template. However,
we will be developing the presentation part
in the “Word Template Builder” therefore we
just want to save the report at this time.
68. BIP – Create Report – Word Template Builder
• Switch to MS WORD
• Select BI Publisher Add-in tab
• Log into BIP
• Load XML file (that we created from the Data Model)
• Create the report’s layout in WORD (general steps)
• Add Table for the Report Header
• Add Table for the holding area for data for each Activity Code Value
• Save WORD file as RTF
• Upload Template to BIP Report
69. BIP – Create Report – Word Template Builder
Log On
Enter Username
Enter Password
Enter IP of BIP server
70. BIP –Template Builder – Select Report
Select Report
Layout Templates
If Barchart was a new report, there
would not have been any templates
but in our example, we already
uploaded a template to this BIP report
71. BIP –Template Builder – Load XML Data
Select XML File
This file was created by
the DM
72. BIP –Template Builder – Create Layout – Add Tables
1. Add Tables
To start, I will add 2 tables
using WORD’s standard
features
And I’ll add some
formatting to the bottom
table
73. BIP –Template Builder – Create Layout – Add Tables
I put a grey background on the title
row then I shifted the column
widths so that I can display 6
columns of data and 1 larger column
for the bars
This will be my report header
The hash marks are actually an image that I built using
WORD’s graphics features. The image was inserted in
the title row.
We could not find an easy method to automatically
generate the hash marks, but with time we probably
would have found a solution.
We will be adding data elements from the ChartDates
DS for dates above the hash marks
74. BIP –Template Builder – Create Layout – Add BIP Repeating Group
1. Move cursor to the 2nd
row, 1st column
We need to add a repeating group that will repeat for each row in IndividualBars/G_2
2. Click on the BI Publisher tab and click on
“Repeating Group” object
75. BIP –Template Builder – Create Layout – Add BIP Repeating Group
Under Properties tab, select G_2
Under Sort tab, select ACTCODEVALUE
Under Advanced tab, you can see the XLS code that gives the
power to building reports with the WORD Template Builder.
We will not be changing anything under this object but I
wanted to bring it to your attention.
76. BIP –Template Builder – Create Layout – Add BIP Repeating Group
After adding the
repeating group, a “F”
and a “E” are added to
your table
representing the
beginning and end of
the repeating group.
We need to Cut/Paste
the “E” and move it to
the right.
Next, we will insert data elements
from G_2 into the table cells – in
between the “F” and the “E”
77. BIP –Template Builder – Create Layout – Add Data Elements to Cells
To add Data Elements to our template, click on the Field object.
Then scroll down to the Data Elements in G_2
Next, select the Data Element (such as
ActCodeValue) and drag and drop into a cell
78. BIP –Template Builder – Create Layout – Add Data Elements to Cells
After inserting ActCodeValue, we move the Data Element
right after the “F” by removing the CR after “F”
Then we will insert additional Data
Elements and format them
79. BIP –Template Builder – Create Layout – Add Data Elements to Cells
After inserting Sum_PlannedLaborUnits, select it in the cell and do a right click.
Then select “BI Publisher” then select “Properties”
Continue on next slide
80. BIP –Template Builder – Create Layout – Add Data Elements to Cells
Change the Type to Number with
a format of 0 (no decimal
positions).
After clicking “OK”, notice how the Data Element name is no longer visible
81. BIP –Template Builder – Create Layout – Add Data Elements to Cells
Insert the following 4 Data Elements into the other 4 cells and format them:
Sum_EarnedValueLaborUnits, Sum_RemainingLaborUnits, BLStartDate, and BLFinishDate
Next, we need to insert a WORD shape (a black RECTANGLE) with a width equal to the distance
between the hash marks.
Then we are going to enter instructions behind the shape that tells the shape its starting horizontal
position and number of times to repeat the shape
82. BIP –Template Builder - Create Layout – Add Shape for Durations Bar
First move the cursor to position after
the “E” then click on “Shapes” button.
Then, select and insert a RECTANGLE into
the cell.
After the Shape is added to the cell, we need to write XSL
code (behind the RECTANGLE) to control its behavior.
83. BIP –Template Builder - Create Layout – Add Shape for Durations Bar
Select the RECTANGLE then
do a right click, then select
“Format AutoShape”.
Select the “Alt Text” tab.
Under the “Alt Text”, enter
XSL code to control the
behavior of the RECTANGLE.
84. BIP –Template Builder - Create Layout – Add Shape for Durations Bar
The logic is:
For every record in G_2 (for‐each), do the following:
If the DATE_DURATION Data Element in G_2 exists,
Move the shape’s offset to
(“STARTDATE_OFFSET” * 5.00) + 0.25
using
<?shape‐offset‐x:(STARTDATE_OFFSET*5.00)+0.25?>
Then repeat the shape DATE_DURATION times
going to the LEFT using
<?shape‐size‐x:(DATE_DURATION);'left'?>
NOTE: You will need to tweak the values (such as 5.00
and 0.25) and tweak the position of the shape in the
cell to get it just right.
Also NOTE: For a true test, upload the template to BIP
and run the report from BIP.
85. BIP –Template Builder - Create Layout – Add Shape for EV Percentage
Next, we will add another RECTANGLE (this shape
will be RED). The RED RECTANGLE will be the same
width as the BLACK bar but its height will be
smaller so that the RED bar is within the BLACK bar
when the report is rendered).
The BLACK bar represents the time duration (in
days) for the activities with this Activity Code
Value.
The RED bar will represent the amount of Earned
Value in % of the BLACK bar.
So – the logic behind the RED bar is similar to the
logic behind the BLACK bar but the duration is a
calculation.
See Next Slide
86. BIP –Template Builder - Create Layout – Add Shape for EV Percentage
For every record in G_2 (for‐each), do the following:
If the DATE_DURATION Data Element in G_2
exists, move the shape’s offset to
(“STARTDATE_OFFSET” * 5.00) + 0.0
using
<?shape‐offset‐x:(STARTDATE_OFFSET*5.00)+0.0?>
Then repeat the shape DATE_DURATION times
going to the LEFT using
<?shape‐size‐x:(DATE_DURATION)*(P_EV);'left'?>
87. BIP –Template Builder - Create Layout – Duplicate Cells on Total Row
We need to repeat the steps for the total row,
HOWEVER the total row will use Data Elements
from G_1 (instead of G_2) – and this includes the
XSL code behind the shapes on the total row.
Note the group G_1 has the totals from the Data
Model
Logic for Total Row BLACK bar:
<for‐each@shape:G_1?>
<?if:PRJ_DATE_DURATION?>
<?shape‐offset‐x:(PRJ_STARTDATE_OFFSET*5.00)+0.25?>
<?shape‐size‐x:(PRJ_DATE_DURATION);'left'?>
<?end for‐each?>
Logic for Total Row RED bar:
<for‐each@shape:G_1?>
<?if:PRJ_DATE_DURATION?>
<?shape‐offset‐x:(PRJ_STARTDATE_OFFSET*5.00)+0.00?>
<?shape‐size‐x:(PRJ_DATE_DURATION)*(PRJ_P_EV);'left'?>
<?end for‐each?>
88. BIP –Template Builder - Create Layout – Add Titles
Now for the finishing touches ….
The top of the report is a table so I’ll layout the cells so that it is organized.
Add the column headers (such as “Activity Value”) to the 2nd table
90. BIP – Create Report – Word Template Builder
• To upload Template into BIP
• Save Report File in WORD as a RTF file
• Select “Upload Template As” on BI Publisher Add-in tab
• Save Template to the BIP Report
• Login into BIP
• Open/Edit Report
• Select Template Layout (that we just uploaded from Word Template Builder)
• View Report
• Move Report and DM to P6Reports folder and reattach DM to Report
95. 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