Joining Workplan and baseline values

When accessing via SQL, where can I find a unique Identifier to join tables so as to display the currently active “BASE_LINE” WP_TASK_COSTS.PLAN_OP_LABOR_BSE alongside the “WORK_PLAN” WP_TASK_COSTS.PLAN_OP_LABOR_BSE?
I have searched through all available fields in PM_WORK_PLANS, WP_TASKS, WP_TASK_INFO, WP_TASK_ACTUALS and WP_TASK_COSTS… It appears there is no way to associate the tasks, but it is demonstrated in the  workplan view  in the tool:

  • Suggested Answer

    0  

    Hi Damon,

    The first table to look at is PM_WORK_PLANS, which contains the PPM Work plans, both active work plan (IS_ACTIVE_FLAG=Y) and Base line work plans (IS_ACTIVE_FLAG=N). You also have Work plan templates stored in there, but I assume that that you'll want work plans & baselines for a specific project so just ensure that you have the right PROJECT_ID value.
    This table will provide you the right WORK_PLAN_ID for the active work plan and the Baseline work plan(s) that you want to compare.

    Once you have the WORK_PLAN_ID, check in table WP_TASKS to find all the tasks that belong to this work plan, based on column WORK_PLAN_ID. And you can start from this table WP_TASKS to get the task costs or task info as you have the values of TASK_COST_ID and TASK_INFO_ID that will point you to the right record in tables WP_TASK_INFO and WP_TASK_COSTS.

    Now, the tricky part here is that it's not very "straightforward" to identify the "same" task in two work plans, even if these two work plans are the baseline and the active work plan of a same project - because changes could occur, and the work plan structure might change a lot between an old baseline and the latest active work plan. 
    You definitely cannot rely on "WP_TASKS.TASK_ID", because this is a unique identifier that will always be different between two tasks, even if these two tasks represent the "same" task between a baseline and an active work plan. You could try to use the task name in task info or the task sequence or path, but this doesn't guarantee to have a perfect match - instead, the trick is to use "WP_TASKS.BUSINESS_UID", as if you task is from a baseline it contains the Task ID of the active work plan task this task was a copy of. However, keep in mind that if you create a baseline, then delete a task in the active work plan and recreate a new task in the same position and with the same name, the Task ID will be different and thus BUSINESS_UID will be useless - so here again, there's no guarantee that it will always work.

    In any case, this information will hopefully help you get what you're looking for.

    Also, please be aware that the whole PPM Database Data Model is documented in PPM Online Help. It includes a short description of all the tables & columns as well as some ER diagrams that will help you figure out how tables are related to each other:

    For work plans:

    For Tasks: 

    Let us know if you have any other question.

  • 0 in reply to   

    Thank you for your reply, however this is what I already knew... Disappointed

    So, theres really no way to associate them properly with a query, that is very disappointing.

    How is it done in the tool?

  • 0   in reply to 

    Hi Damon,

    I don't understand, if you know the relationship between the tables and how to get data from both tasks of the active work plan and tasks of the baseline work plan, what exactly is blocking you from writing the SQL that you're looking for? What information that you need is missing from the tables that I shared earlier?

    As for answering the "how does the product does it" question, did you try to enable the debug console and look at the SQL executed on the page showing the information that you're looking for? As this lists all the SQL queries executed as part of answering a specific PPM HTTP Requests, all the SQL queries you should need should be in there - but just keep in mind that it may not be one single SQL query. 

  • 0 in reply to   

    I still have no way to join the two together in a single line consistently while maintaining the sequence.

  • 0   in reply to 

    1) Did you see the part about using BUSINESS_UID to match tasks between Baseline and active work plan? 

    2) Did you try to use the Debug Console to check the SQL queries used to generate the screenshot you shared above?