www.regouniversity.com clarity educational community accessible data advanced data model presented...

32
www.regouniversity. com Clarity Educational Community Accessible Data Advanced Data Model Presented By: Virginia DeCeglia, Chris Schaffer | Date Prepared: May, 2015

Upload: walter-gibson

Post on 19-Dec-2015

244 views

Category:

Documents


1 download

TRANSCRIPT

www.regouniversity.comClarity Educational Community

Accessible DataAdvanced Data Model

Presented By: Virginia DeCeglia, Chris Schaffer | Date Prepared: May, 2015

2 Clarity Educational Community

Agenda• Data Model Overview• Database Navigation• Frequently Accessed Areas

– Timeslices– OBS

• CA PPM Database Content– Portfolio contents– Financial Plans & Financial Actuals– Hierarchy– Idea to Project

3 Clarity Educational Community

Data Model OverviewThree main areas where data is stored

– Core Tables• Production tables used for day to day functions• Includes

– Investment– Resource– Timesheet Information

• Data updates in real time (Live Tables)– Time Slice Tables

• Houses summarized data by Daily, Weekly, Bi-Weekly, Monthly, Bi-Monthly, Quarterly, Semi-Annually, Yearly views

• Usually populated via a job process – Time Slice• Some tables are populated using instaslice, an internal function called during specific user

activities• Time Slices are critical in defining how much data is summarized and the time frame in which the

data can be pulled– DataMart Tables

• Provides Summary and Rollup Data• Populated via several job processes – Rate Matrix Extraction, DataMart Extraction, Datamart

Rollup

4 Clarity Educational Community

Database NavigationObjects Naming Convention – Tables

Understanding table prefix definitions helps you navigate to the correct schema area to find needed information. The majority of prefixes in the current CA PPM schema are listed here.

Prefix Component / MeaningNBI DatamartNTD DiscussionsODF Object Definition FieldsPAC Project AccountingPFM Portfolio ManagementPPA Financials (WIP and Matrix Values)PRJ ProjectsRSM Resource ManagementSRM Shared SRM Objects (Resources,

Companies)

Prefix Component / MeaningBIZ Business DevelopmentBPM Business Process ManagementCAL CalendaringCLB CollaborationCMN Common (Security, Jobs, Reports,

Views, Attributes, etc.)COP PMO AcceleratorFIN Financials (Cost Plans, Budgets)INV Investments

5 Clarity Educational Community

Database Navigation, cont.Objects Naming Convention – Stored Procs, Functions, Triggers, etc.Type Type ID Description

Primary key constraints and indexes PK Primary key constraints need to be named explicitly as they control the name of the primary key index (which is automatically created)

Foreign key constraints FKx Foreign key constraints need to be name explicitly (“alter table XYZ add XYZ_FK1 foreign key..”)

Check constraints CKx i.e. CK1 or CK2

Unique indexes Ux i.e. U1

Non-unique indexes Nx i.e. N1 or N2

Sequences (Oracle only) Sx i.e. S1 or S2. S1 is used for primary key sequences only, i.e. CMN_LOOKUPS_S1

Triggers TRGx or Tx i.e. TRG1 or TRG2, T1 or T2

Packages PKG

Stored Procedures SP

Functions FCT

Views V

Aggregate / Summary Tables SUM

Custom Z_ or ZZ_ Addition of custom objects to on premise instances should be signified by “Z_” or “ZZ_” . This allows the ability to identify customizations simply during an assessment or upgrade initiative

6 Clarity Educational Community

Database Navigation, cont.Common Columns

All tables in CA PPM house the following attributes. Each time a custom object is created, these are added by default.

Column ID DescriptionCREATED_DATE Date/time record was createdCREATED_BY User that created the record. Foreign

key to CMN_SEC_USERS.IDLAST_UPDATED_DATE Date/time record was last updatedLAST_UPDATED_BY User that last updated the record.

Foreign key to CMN_SEC_USERS.ID

7 Clarity Educational Community

Frequently Accessed Areas• A time slice is a flat table containing data derived from a sliced binary

large object (BLOB)– A BLOB is a collection of binary data stored as a single entity in a database– Most reporting tools cannot read a BLOB

• Use time slices to view and report on data over time– Time slices break down the BLOB by several time intervals, such as daily,

weekly, and monthly.

• The majority of time slice data is stored in the PRJ_BLB_SLICES tables with data being controlled by the Time Slicing job

• Slice data not in PRJ_BLB_SLICES is controlled via internal slices, triggered by a user action in CA PPM

• The PRJ_BLB_SLICEREQUESTS table lists all slices and the tables where the information is stored

8 Clarity Educational Community

Frequently Accessed Areas, cont.Time Slices

Slices within the PRJ_BLB_SLICEREQUESTS table containing populated fields like frequency, from and to date are all populated via the Time Slice job. You can configure and control most of these via the Time Slice area within CA PPM. Examples are listed below.

PRJ_BLB_SLICEREQUESTSslice_request_idPRJ_BLB_SLICES

PRJ_BLB_SLICES_xODF_SL_x

SLICE_REQUEST_ID: Used to connect to PRJ_BLB_SLICEREQUESTS table

PRJ_OBJECT_ID: Used to connect to object instance in question. i.e. Resource id, investment id, etc.

SLICE: Value of slice

SLICE_DATE: Date of slice (based on interval)

# Slice Name1 DAILYRESOURCEAVAILCURVE2 DAILYRESOURCEACTCURVE3 DAILYRESOURCEESTCURVE

10 DAILYRESOURCEALLOCCURVE11 DAILYRESOURCEBASECURVE

164 DAILY_INVESTMENT_ESTIMATES4 MONTHLYRESOURCEACTCURVE5 MONTHLYRESOURCEESTCURVE6 MONTHLYRESOURCEALLOCCURVE7 MONTHLYRESOURCEAVAILCURVE

9 Clarity Educational Community

Frequently Accessed Areas, cont.Internal Slices

Slices within the PRJ_BLB_SLICEREQUESTS table without populated fields like frequency, from and to date are updated via internal slices (insta-slice), and takes place after a user action in CA PPM. Examples are listed below.

ODF_SSL_x PRJ_BLB_SLICEREQUESTSslice_request_id

SLICE_REQUEST_ID: Used to connect to PRJ_BLB_SLICEREQUESTS table

PRJ_OBJECT_ID: Used to connect to object instance in question. i.e. Resource id, investment id, etc.

SLICE: Value of slice

SLICE_DATE: Date of slice (based on interval)

# Slice Name5000020 costplandetail::cost::segment5000024 costplandetail::units::segment5000070 benefitplandetail::benefit::segment5000072 benefitplandetail::variance::segment5000076 benefitplandetail::actual_benefit::segment

10 Clarity Educational Community

• Pull a resource’s ETC per project

Time SlicingExercise #1A

select i.code, i.name, r.full_name, sum(SLICE) etcHoursfrom prj_blb_slices sl , srm_resources r, prassignment a, prtask t, inv_investments iwhere sl.PRJ_OBJECT_ID = a.pridand SLICE_REQUEST_ID = 5and r.id = a.PRRESOURCEIDand a.PRTASKID = t.PRIDand t.PRPROJECTID = i.IDand i.code = ‘xxxx’group by i.code, i.name, r.full_name

11 Clarity Educational Community

• Pull a project’s cost plan and budget information by month for the current year

Time SlicingExercise #1B

SELECT I.CODE invID, FP.CODE planID,REPLACE(CONVERT(VARCHAR,cpu.start_date,111),'/','-')+'T00:00:00' start_date,REPLACE(CONVERT(VARCHAR,(DATEADD(s,-1,DATEADD(mm,DATEDIFF(m,0,cpu.start_date)+1,0))),111),'/','-')+'T00:00:00' finish_date,SUM(ROUND(cpu.slice*(datediff(day,cpu.start_date,cpu.finish_date)),2)) costFROM INV_INVESTMENTS I, INV_PROJECTS IP, FIN_PLANS fp, fin_cost_plan_details fpd, srm_resources r, odf_ssl_cst_dtl_cost cpuWHERE I.ID = IP.PRID AND IP.IS_PROGRAM = 0 AND fp.object_id = i.id AND fp.object_code = 'project‘ AND fp.is_plan_of_record = 1 AND fp.plan_type_code = 'FORECAST‘ AND fp.id = fpd.plan_id AND fpd.prrole_id = r.id AND fpd.id = cpu.prj_object_id AND fpd.source = 'COSTPLAN'

12 Clarity Educational Community

Frequently Accessed Areas, cont.OBS Data Model

– OBS is an integral part of each piece of data within CA PPM, especially with the categorization of resources and investments

– Determining and filtering on the related OBS for different objects is often a challenge during day to day reporting

– The core live tables for OBS do not rely on any jobs for population, but are recorded as soon as an OBS change is made in the system • PRJ_OBS_UNITS – Holds all units within each OBS structure, the depth at

which it lies in the system, and it’s parent unit• PRJ_OBS_ASSOCIATIONS – Holds the association between investment or

resource and the OBS unit itself• PRJ_OBS_TYPES – Holds the definition of each OBS structure

– The NBI_DIM_OBS table stores flattened OBS information, including the full path of the OBS unit• This table is dependent on the Datamart Extraction being run

13 Clarity Educational Community

Frequently Accessed Areas, cont.OBS Data Model – Views / Tables (other)• You can use additional OBS tables and views to help you find hierarchical relationships between

units.• You can use tables like PRJ_OBS_UNITS_FLAT to query for a unit and all its descendants. For

example:select pu.name branchName, pu.DEPTH branchLvl, cup.name ParentOBS, cu.name ChildOBS, cu.DEPTH childLvlfrom prj_obs_units_flat uf, prj_obs_units pu, prj_obs_units cu, prj_obs_units cupwhere uf.branch_unit_id = pu.idand uf.UNIT_ID = cu.idand cu.PARENT_ID = cup.idand pu.name = 'XXX’

• You can use views like OBS_UNITS_V to query for a unit and decide for that unit only its descendants, ancestors, or all related units. For example:

select u.name unitName, pu.name parentUnit, uv.NAME childUnit, uv.DEPTH childDepthfrom obs_units_v uv, prj_obs_units u, prj_obs_units puwhere u.id = uv.unit_idand u.name = ‘XXX'and uv.UNIT_MODE = 'OBS_UNIT_AND_CHILDREN'and uv.PARENT_ID = pu.id

14 Clarity Educational Community

Frequently Accessed Areas, cont.OBS Data Model – Functions

– Finding the OBS path is a common need for portlet and report writing.

– It is not always necessary to connect to the NBI_DIM_OBS table to get this information if it is needed in real time.

– The NBI_GET_OBS_PATH_FCT can be used to pull the path of the current OBS unit by passing it the internal unit ID of the OBS unit. For example:select u.id, NBI_GET_OBS_PATH_FCT (u.id) obsPathfrom prj_obs_units u

15 Clarity Educational Community

• Find the OBS path of all active resources

OBS Data ModelExercise #2A

SELECT r.full_name, obs.pathFROM NBI_DIM_OBS obs, PRJ_OBS_ASSOCIATIONS assoc, SRM_RESOURCES rWHERE obs.obs_unit_id = assoc.unit_id AND assoc.record_id = r.id AND assoc.table_name = ‘ SRM_RESOURCES’AND obs.obs_type_name = <name of OBS>

16 Clarity Educational Community

• Return only the investments within a specific branch of the OBS

OBS Data ModelExercise #2B

Select u.name unitName, uv.NAME childUnit, i.name, i.codefrom obs_units_v uv, prj_obs_units u, Prj_obs_associations assoc,Inv_investments iwhere u.id = uv.unit_idand u.name = ‘XXX'and uv.UNIT_MODE = 'OBS_UNIT_AND_CHILDREN'And uv.LINKED_UNIT_ID = assoc.unit_idAnd assoc.table_name = 'SRM_PROJECTS'And assoc.record_id = i.id

17 Clarity Educational Community

CA PPM Database ContentPortfolio Contents

– Portfolios allow you to create and review a collection of investments that interest stakeholders in your business

– As of 13.2 portfolios are now stored in a new table structure starting with PFM_, with PFM_PORTFOLIOS being the main table

– Old portfolio contents are archived to the XBKP_PMA tables for reference or conversion

18 Clarity Educational Community

CA PPM Database Content, cont.Portfolio Contents, cont.

– PFM_INVESTMENTS• Contains a copy of investment attributes in the context of a

portfolio• Link to Investment ID is on this table

19 Clarity Educational Community

CA PPM Database Content, cont.Portfolio Contents

– The Waterline view allows you to view and rank the investments in a portfolio

– The below query allows you to find all investments above the waterline

SELECT above_waterline FROM PFM_PORTFOLIO_RANKING_V wl WHERE wl.context_id = {PFM_PORTFOLIOS.ID}JOIN INV_INVESTMENTS inv ON inv.id = instance_idAND context_type = 'pfm' above_waterline = 1

20 Clarity Educational Community

Portfolio ContentsExercise #3

Select INV.Name,INV.Code,PP.Name PortfolioName,pp.CODE PortfolioCode

From PFM_PORTFOLIOS PP, PFM_INVESTMENTS PI, INV_INVESTMENTS INVWhere pi.Portfolio_id = PP.idand INV.ID = pi.investment_id

21 Clarity Educational Community

CA PPM Database Content, cont.Financial Plan Tables

– Financial Cost, Budget, and Benefit plan data can be found using the following tables• FIN_PLANS – Holds high level information on the type of plan, including start

and end date, overall units and cost, and the period type (MONTHLY, YEARLY, etc.)

• FIN_COST_PLAN_DETAILS – Holds detailed plan data by each group by element and whether it’s been populated manually or via the resource plan

– The following slice tables holds detailed interval data for all financial plan types• ODF_SSL_CST_DTL_COST, ODF_SSL_CST_DTL_UNITS – Holds the detailed cost

and units, respectively, for the cost plan and budget on all investment types• ODF_SSL_BFT_DTL_X – These tables hold the detailed benefit plan

information for all investment types• ODF_SSL_CST_DTL_REV – Holds the detailed revenue information for all

investment types

22 Clarity Educational Community

Financial Plan Tables: Simple Budget ExampleCA PPM Database Content, cont.

SELECT I.CODE, I.NAME, FP.approved, FP.departcode, fp.locationid, FP.CLASS, F.budget_cst_total, F.budget_cst_start, F.budget_cst_finish, F.planned_cst_total, F.planned_cst_finish, F.planned_cst_start, F.planned_npv, F.planned_roiFROM INV_INVESTMENTS I, PAC_MNT_PROJECTS FP, FIN_FINANCIALS F, odf_object_instance_mapping om, INV_PROJECTS IP WHERE I.ID = IP.PRID AND I.ID = FP.ID AND F.ODF_OBJECT_CODE = 'project' AND f.id = om.secondary_object_instance_id AND om.secondary_object_instance_code = 'financials' AND om.primary_object_instance_id = i.id AND om.primary_object_instance_code = 'project' AND IP.IS_PROGRAM = 0

23 Clarity Educational Community

• The below query shows the total cost and hours by detailed financial plan record. This example uses Transaction Class as the group by.

Financial Plan Tables: Detailed Plans Example #1CA PPM Database Content, cont.

SELECT I.CODE invID, I.NAME invName, PMP.departcode invDeptID, PMP.locationid invLocID, FP.NAME ,finPlanName, (select tc.description from SC51361D.transclass tc where tc.id = fpd.transaction_class_id) transclass,(select period_name from biz_com_periods where id = fp.start_period_id) startPer,(select period_name from biz_com_periods where id = fp.end_period_id) endPer, FPD.TOTAL_UNITS , FPD.TOTAL_COSTFROM INV_INVESTMENTS I, PAC_MNT_PROJECTS PMP, FIN_PLANS FP, FIN_COST_PLAN_DETAILS FPDWHERE I.ID = PMP.ID AND FP.OBJECT_ID = I.ID AND FP.OBJECT_CODE = 'project' AND FP.ID = FPD.PLAN_ID AND FP.IS_PLAN_OF_RECORD = 1 AND FP.PLAN_TYPE_CODE = 'FORECAST’

24 Clarity Educational Community

• Expanding on the example from the former slide, this query shows the cost by month

Financial Plan Tables: Detailed Plans Example #2CA PPM Database Content, cont.

SELECT I.CODE invID, I.NAME invName, PMP.departcode invDeptID, PMP.locationid invLocID, FP.NAME ,finPlanName, (select tc.description from transclass tc where tc.id = fpd.transaction_class_id) transclass, cpu.start_date, cpu.finish_date, cpu.sliceFROM INV_INVESTMENTS I, PAC_MNT_PROJECTS PMP, FIN_PLANS FP, FIN_COST_PLAN_DETAILS FPD, odf_ssl_cst_dtl_cost cpuWHERE I.ID = PMP.ID AND FP.OBJECT_ID = I.ID AND FP.ID = FPD.PLAN_ID AND FPD.ID = CPU.PRJ_OBJECT_ID AND FP.OBJECT_CODE = 'project' AND FP.IS_PLAN_OF_RECORD = 1 AND FP.PLAN_TYPE_CODE = 'FORECAST‘

25 Clarity Educational Community

Exercise #4 – Financial Plan Tables• Find the total units and cost for a cost plan of record for a

project and compare it against the budget for that project

SELECT I.CODE invID, I.NAME invName, FP.NAME finPlanName, FP.TOTAL_UNITS cpUnits, FP.TOTAL_COST cpCost, BP.TOTAL_UNITS budUnits, BP.TOTAL_COST budCostFROM INV_INVESTMENTS I LEFT JOIN FIN_PLANS FP ON FP.OBJECT_ID = I.ID AND FP.OBJECT_CODE = 'project' AND FP.PLAN_TYPE_CODE = 'FORECAST' LEFT JOIN FIN_PLANS BP ON BP.OBJECT_ID = I.ID AND BP.OBJECT_CODE = 'project' AND BP.PLAN_TYPE_CODE = 'BUDGET'WHERE FP.IS_PLAN_OF_RECORD = 1

26 Clarity Educational Community

CA PPM Database Content, cont.Financial Actuals Tables

– Financial tables are utilized to capture both hours and cost for resources by project and task. Data gets processed to these tables via the processing of timesheets or via manually entered or imported transactions.

– The financial tables or “WIP” tables are the only ones that keep historical information related to a resource and investment at the point in which the transaction was recorded

– The major tables accessed for financial data are PPA_WIP and PPA_WIP_VALUES

• PPA_WIP – Stores all primary transactions (Labor, Materials, Equipment, and Expense).• PPA_WIP_VALUES – Stores multi-currency values for rows in the PPA_WIP table

– Get the most current transactions by using Status = 0 when querying data– Make sure to choose the CURRENCY_TYPE when querying for cost

PPA_WIP PPA_WIP_VALUEStransno

27 Clarity Educational Community

Exercise #5 – Financial Actuals Table• Query for the hours and cost of each resource on the team of

an investment. Include the following columns in the result set.– Project ID– Project Name– Resource department– Resource role– Total Hours– Total Cost

28 Clarity Educational Community

CA PPM Database Content, cont.Hierarchical Relationships

– Hierarchies within Investments allow for a quick rollup view of information for related children investments in CA PPM. On this slide we will show how to query for those hierarchal linkages

– INV_HIERARCHIES_FLAT• This denormalized table stores data based on INV_HIERARCHIES.

The flattened table contains parent_id and child_id entries for all descendants of a given investment parent_id that has a hierarchy.

• link_source_id contains the ID of the immediate parent of the child and allows rapid retrieval of all descendants within a hierarchy.

• Examining link_source_id also allows you to retrieve the original hierarchical order.

29 Clarity Educational Community

Select MAS.NAME MasterName,MAS.CODE MasterCode,SUB.NAME SubName,SUB.CODE SubCode

FROM INV_HIERARCHIES IHInner Join INV_INVESTMENTS MAS on MAS.ID = IH.PARENT_IDInner Join INV_PROJECTS MP on MP.PRID = MAS.IDInner Join INV_INVESTMENTS SUB on SUB.ID = IH.CHILD_IDInner Join INV_PROJECTS SP on SP.PRID = SUB.idWhere SP.IS_PROGRAM = 0and MP.IS_PROGRAM = 0Order by MAS.Code

Exercise #6 – Hierarchical Relationships

30 Clarity Educational Community

CA PPM Database Content, cont.Hierarchical Relationships, cont.

– INV_HIERARCHIES_FLAT• Join to the INV_INVESTMENTS

on the ID = PARENT_ID or CHILD_ID fields from the hierarchy table.

• Same table is used for multiple purposes.

• Filter for Program! – INV_PROJECTS . IS_PROGRAM

– Reference the Investments twice• Once for Master• Once for Sub

INV_HIERARCHIES_FLAT

INV_INVESTMENTS(Parent)

INV_INVESTMENTS(Child)

INV_PROJECTS

IS_PROGRAMIS_TEMPLATE

INV_PROJECTS

IS_PROGRAMIS_TEMPLATE

PARENT_ID=ID CHILD_ID=ID

ID=PRID ID=PRID

31 Clarity Educational Community

CA PPM Database Content, cont.Idea to Project Linkage

– Ideas often serve as a source for investments (for example, projects), and for early analysis prior to being approved and becoming an investment

– Understanding the reasons why a project is in flight and the original source of the business request is an important link to track in CA PPM. The below tables and SQL will identify the sources of that information.

– INV_INVESTMENTS houses all investment data, such as projects, applications, products, services, other, and even idea.

– This table is all that is required to create the linkage and get the related information:

select i.name prjName, i.code prjID, idea.code ideaID, idea.name ideaNamefrom inv_investments ijoin inv_investments idea on i.idea_id = idea.idwhere i.odf_object_code = 'project'

32 Clarity Educational Community

Questions

Phone888.813.0444

[email protected]

Websitewww.regouniversity.com

We hope that you found this session informative and worthwhile. Our primary goal was to increase your understanding of the topic and CA PPM in general.

There were many concepts covered during the session, if you would like to contact any presenter with questions, please reach out to us.

Thank you for attending regoUniversity 2015!