1. WBS Parent Calculation (2002)

Is there a way to create custom fields in Project, name them Parent WBS and Parent Description, and have it fill in the information from the parent WBS? Example:

WBS Name Parent WBS Parent Description
1.1.1 Child Name 1.1 Parent Name

This is for import into another program that cannot determine the parent WBS.

2. Re: WBS Parent Calculation (2002)

I don't think there is an easy way in Project to create a custom field for what you are looking for. You might try to copy and paste the table data into Excel and use Excel to create the data you need. I looked at it a little bit in Excel and did not come up with a formula for the calcualtions you are looking for, but if you were to post some example data on the Excel board there are many loungers that participate in the Excel board that are really quick at finding custom solutions for data.

3. Re: WBS Parent Calculation (2002)

Randy,

Interesting question. However, in project, since there could be multiple predecessors, you would more then likely have more then one parent. How would you address this or how would you define a parent?

4. Re: WBS Parent Calculation (2002)

Gary,

Not really talking about predecessors, but rather the next higher level in the WBS tree. Example: I am using a 1, 1.1, 1.1.1, 1.1.1.1, 1.1.1.1.1 format of numbering for the WBS code. The parent of 1.1.1.1.1 would be 1.1.1.1 The parent of 1.1.1 would be 1.1 and so forth. Actually all I need it to do, and have figured out how to do in Access is to remove the last ".'" and all numbers after it. It is not very simple as some of my WBS numbers are like this: 1.3.12.15 and need to calculate the parent by removing ".15" from the number. Does that make it easier to figure out? It just seems that Access does it just a little easier, but I am trying to get Project to be able to export just the right information without having to use a translator program such as Access.

Thanks if you can help.
Randy

5. Re: WBS Parent Calculation (2002)

Randy,

I was testing out a "calculated field" with the following formula to see if it would work for your solution:

Switch(InStr([WBS],".")=0," ",Mid([WBS],Len([WBS])-1,1)=".",Mid([WBS],1,Len([WBS])-2),Mid([WBS],Len([WBS])-2,1)=".",Mid([WBS],1,Len([WBS])-3))

I used a customized Text field (Text30) and entered the above formula into the Custom attributes | Formula..., and also selected the "Use formula..." option under the "Calculation for task and group summary rows" section. The formula is not working for the first SWITCH case that I have above, but "seems" to work for the second and third. Maybe one of the MSP pros can help to take it to the "next level" for you.

I'll keep trying, also....

6. Re: WBS Parent Calculation (2002)

Randy ,
I looked at Don's post and it gave me this idea. Try creating a custom Text field using the following formula:
IIf(Len([WBS])>1,Left([WBS],(Len([WBS])-2)))
Post back if this works, if not I will look again
Carla

7. Re: WBS Parent Calculation (2002)

Thanks for the input from both. However, each produced the same results.

They worked fine for any WBS over 3 digits. 1.1.1.1 was calculated to be 1.1.1
For the WBS numbers less than 4 digits, 1.1.1 the calculated field was blank. So was 1.1

If you come up with anything else, let me know.

8. Re: WBS Parent Calculation (2002)

Hi Randy,

Take a look at the attached file to see if it is what you want.

Carla

9. Re: WBS Parent Calculation (2002)

Carla,

You are getting closer. The only problem now is (as best as I can describe it) that I have some WBS numbers that end in 2 digits.
Example of what it's doing: 1.2.2.12 comes out 1.2.2.
Your last LEN command is -2 as to remove the last 2 characters. What I am thinking is there needs to be a way to remove the last "." and everything after it.

Any ideas?
Thanks
Randy

10. Re: WBS Parent Calculation (2002)

I don't know if you will have any joy with custom field formulas but you can do this if you use a macro to do the heavy lifting. The following code seems to work for me.
<pre>Function WhosYourDaddy(aStr As String) As String
Dim aStrFind As String
aStrFind = "."
If InStr(aStr, aStrFind) > 0 Then
WhosYourDaddy = Left(aStr, InStrRev(aStr, aStrFind) - 1)
End If
End Function
Sub DNA_Test()
Debug.Print tChild.WBS
If tParent.WBS = tChild.Text2 Then
tChild.Text3 = tParent.Name
End If
Next tParent
Next tChild
End Sub</pre>

11. Re: WBS Parent Calculation (2002)

Randy,

This should work even if you have 1 or 2 digits ending your wbs. If you have 3, then thats another issue!

Put the following code in your text field.

Left(WBS,Instr(Len(WBS)-2,WBS,".")-1)

HTH

12. Re: WBS Parent Calculation (2002)

Andrew,

You are my savior! It does exactly what I was looking for and will reduce my work by hours each month.

Thank you!

13. Re: WBS Parent Calculation (2002)

Randy,

Due to my compulsive nature....
...and combining of Cathy's and Andrew's approaches, if you need the formula extended to work with "hundreds" (i.e., 3 digit nodes in WBS - e.g., 1.2.256) of subtasks at any given level - try:

IIf(InStr([WBS],".")=0," ",IIf(Mid([WBS],Len([WBS])-1,1)=".",Left([WBS],Instr(Len([WBS])-2,[WBS],".")-1),IIf(Mid([WBS],Len([WBS])-2,1)=".",Left([WBS],Len([WBS])-3),IIf(Mid([WBS],Len([WBS])-3,1)=".",Left([WBS],Len([WBS])-4)))))

This formula can be extended to accommodate additional numbers of digits at any given WBS level by nesting more IIF statements.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•