Guild of Project Controls: Compendium | Roles | Assessment | Certifications | Membership

Tips on using this forum..

(1) Explain your problem, don't simply post "This isn't working". What were you doing when you faced the problem? What have you tried to resolve - did you look for a solution using "Search" ? Has it happened just once or several times?

(2) It's also good to get feedback when a solution is found, return to the original post to explain how it was resolved so that more people can also use the results.

WBS full decimal delineated number

6 replies [Last post]
Casey F
User offline. Last seen 1 year 36 weeks ago. Offline
Joined: 28 May 2016
Posts: 17

Does anyone know how P6 creates the decimal delineated WBS number. It is not exported in a column that can be quickly referenced and I'm looking to recreate it for reporting purposes.

 

EXAMPLE: the project number is 1234567, and a child WBS is 1234567.1, how is this number created? As these numbers do not exist in the .xer export.  

Replies

Steven Auld
User offline. Last seen 7 weeks 1 day ago. Offline
Joined: 13 Sep 2017
Posts: 126

Casey,

The simplest way of getting this visible in the XER File is to create a User Defined field to store the WBS Path in then use a Global Change to set this UDF Field = WBS Path.

Then you would only have to link the Activity to the WBS Path User Defined Field value instead from trying to recreate the WBS Path from the PROJWBS values.

This would only give you the WBS Path where they have been assigned to an activity & not all WBS Code Values.

Steven

Steven Auld
User offline. Last seen 7 weeks 1 day ago. Offline
Joined: 13 Sep 2017
Posts: 126
No problem. Glad I could help. Steven
Casey F
User offline. Last seen 1 year 36 weeks ago. Offline
Joined: 28 May 2016
Posts: 17

Thank you all for the help!  This is exactly what I was looking for.  I was previously informed that these numbers were generated as the program displayed, but i knew there had to be a way to build them from the tables.  Thank you agian!

Steven Auld
User offline. Last seen 7 weeks 1 day ago. Offline
Joined: 13 Sep 2017
Posts: 126

Casey,

Seems to be some confusion over the term Project Number - is this the "proj_id" value, or "wbs_short_name" value.

When you create a new Project in Primavera, it asks you for a "Project ID" & "Project Name".

The Project ID is saved in 2 places in the Database & is saved as a Text Value, regardless of whether a number is entered or not.

In the PROJECT Table, it is saved as "proj_short_name" - This is then allocated a unique ID by the database - this is an auto incrementing number (integer - whole number only) that is used only once to ensure it is unique - "proj_id" - this is saved as the Primary Key for the PROJECT Table, so that it can be referred to in all the related Tables. If you try to create another project with the same name, Primavera will check to see if it already exists & will not allow you to add the same value again, as this is the value that it searches for when you import an XER file. If you were to delete this project, you could add the same Project ID back in again, but the "proj_id" value will be different.

The Value entered as the Project ID is then also saved to the PROJWBS Table as the "wbs_short_name" & the Project Name you provided earlier to create the Project  is saved as the "wbs_name". The software allocates another Primary Key to this entry to the database which is the "wbs_id" - again this is an auto incrementing numerical ID. When this Project Name is entered into the PROJWBS Table, then the "proj_node_flag" is set to "Y" to indicate that this is the Project WBS Code value & not a child WBS Value. The Primary Key from the PROJECT Table is added as the "proj_id" value.

When you then add a child WBS Code to the Project, it will allocate the next ID number available in the database for the "wbs_id", it will add the Primary Key from the PROJECT Table as a Foreign Key to the PROJWBS Table as the "proj_id" value in the XER File. The Text that you enter for that WBS Code Value will be saved as the "wbs_short_name" value in the database / XER File - this is only saves as to whatever value you have entered in Primavera - Not the Combined WBS Code Value - the Parent WBS Code is saved as the numerical "parent_wbs_id" which is the PROJWBS Table Primary Key Vale for the Parent WBS Code Assigned in the Primavera Application.

The "wbs_short_name" record in the database holds a maximum of 40 Characters - This is the maximum value that can be set from the Admin Preferences, as any more than that cannot be saved in the Database.

In order to rebuild the WBS Path from the XER File, you would need to look at the PROJWBS Table values for the "wbs_short_name" that you created for the Project - The "proj_node_flag" should be "Y" & you will then see the "wbs_id" for the Project.

For the 1st Level WBS Codes under the Project, search the "parent_wbs_id" values for the "wbs_id" of the Project that you just identified. 

If you look at the PROJECT Table for the "name_sep_char" field, this shows you what was selected when the project was created.

The WBS Path can then be rebuilt using the "wbs_short_name" for the project + "name_sep_char" + "wbs_short_name" for the Child WBS.

You would need to loop through each "wbs_id" in the "parent_wbs_id" to recreate the full WBS Path.

The Child WBS of 1234567.1 is not stored with this as its description, but is made of the 2 parts combined together with the "name_sep_char" value - it may be a Hyphen & not the "." value, so you could have had 1234567-1 instead.

If the Database was to store the full value, then it would make it harder if you were later move the WBS Code Value to a different Parent WBS Code.

i.e. if you later moved it so that instead of being directly linked to the Project Value it went as a Child to another WBS Code Value it would then become 1234567.NewWBS.1, where NewWBS is the WBS Code value added - The WBS Details would still be retained, but just the "parent_wbs_id" value is updated so that it then references the new parent.

It can be recreated in excel, but would require you to use the VLOOKUP function starting with the required child value, search the "wbs_id" column of the PROJWBS Table for the "parent_wbs_id" - Add the wbs_short_name of the Parent WBS to the start of the wbs_short_name with the "name_sep_char" value in between, then repeat looking up the next "parent_wbs_id" value & adding to the front of the code.

This would then rebuild the WBS Path.

In your example, you would have the "wbs_short_name" of 1 (which may be repeated but with a different "parent_wbs_id" value), look at the "parent_wbs_id" value & search the "wbs_id" column to find the match (there will be only 1) in your example above the "wbs_short_name" will be equal to 1234567 - Join them together to get the result.

A lot of the Primavera constraints are defined in the Application software & not at the database level.

You can create 2 WBS Codes with the same WBS Code Value & WBS Code Description, but they cannot have the same "parent_wbs_id" value, similarly you cannot have 2 WBS Names that are identical with the same "parent"_wbs_id", even if the WBS Code Value is different.

I have created my own software code that will allow me to import a WBS Code Structure from excel & generate this as an XER File to import straight into Primavera by basing this on the above.

Zoltan,

You are correct, you cannot have 2 activity ID's the same in one Project - the P6 application checks against the "proj_id" value & the "task_code" value to ensure that it does not already exist. This is because this is the value that Primavera will search for to update from a different XER file.

If importing a different project, but 2 tasks have the same Activity ID (or "task_code") then the existing version would be overwritten, even if they were from different projects being imported into your database (if Update Existing is set in preferences). - I know you already know this, but just explaining for others!

Zoltan Palffy
User offline. Last seen 4 weeks 3 days ago. Offline
Joined: 13 Jul 2009
Posts: 3089
Groups: None

every every every wbs ALWAYS ALWAYS ALWAYS begins with the PROJECT ID NUMBER

this done on purpose so that you can link 2 projects together. The 2 projects that you are linking togther both may have the same activity id in it. So what makes it unique is the wbs and the activiy ID you will NEVER EVER EVER have an activity id and project id be the same. 

Steven Auld
User offline. Last seen 7 weeks 1 day ago. Offline
Joined: 13 Sep 2017
Posts: 126

The code does not actually exist within the P6 database as a combined code value.

The code is the project WBS code value and the next WBS level combined with the decimal point as a character separator.

When you create the project in P6, you also have the option of using the hyphen as a separator.

If you are trying to recreate this from the XER file, you would need to take the Project Code + “.” + wbs Code value.

For the next child WBS, take the last code created then add the “.” then the next code.

The code can be viewed in Primavera as it joins up all the values internally & displayed in the WBS path.

The excel equivalent would be to use concatenation to join them up with the decimal separator.

The numbers you are quoting could just as easily be text values, but with the same separator.

Hope that makes sense.

Steven