Sum all Planned Hours and convert to % | Community
Skip to main content
Level 4
February 14, 2024
Solved

Sum all Planned Hours and convert to %

  • February 14, 2024
  • 1 reply
  • 1626 views

Hi WF Community,

 

I am seeking help with my code. I wanted to sum all planned hours and aggregate to a percentage, but it was not showing me any results 😞 Might be a syntax error. Here's my code.

 

aggregator.function=SUM
aggregator.valuefield=estCapacity
displayname=EST Capacity
textmode=true
valueexpression=DIV(SUM({workRequired}),160)
valueformat=HTML

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by J_Mas

Hi @j_mas ,

 

160 is the total number of hours in a month. We multiply 40 hours per week by four to get 160.


Ah, I see. I think you want to use 9600 instead of 160. It's my understanding that most time-related calculations in Workfront are done in minutes, not hours (even though the field says planned "hours"). So, 60 minutes * 160 hours = 9600.

Try this:

aggregator.displayformat=val
aggregator.function=SUM
aggregator.namekey=estCapacity Calc
aggregator.valueexpression=ROUND(DIV(SUM({workRequired}),9600)*100,2)
aggregator.valuefield=ROUND(DIV(SUM({workRequired}),9600)*100,2)
aggregator.valueformat=val
displayname=EST Capacity
textmode=true
valueexpression=ROUND(DIV(SUM({workRequired}),9600)*100,2)
valueformat=val

1 reply

J_Mas
Level 5
February 14, 2024

Give this a try:

aggregator.displayformat=doubleAsPercentRounded
aggregator.function=SUM
aggregator.namekey=estCapacity Calc
aggregator.valueexpression=ROUND(DIV(SUM({workRequired}),160)*100,2)
aggregator.valuefield=ROUND(DIV(SUM({workRequired}),160)*100,2)
aggregator.valueformat=customNumberAsPercentRoundedString
displayname=EST Capacity
textmode=true
valueexpression=ROUND(DIV(SUM({workRequired}),160)*100,2)
valueformat=customNumberAsPercentRoundedString

A_ENAuthor
Level 4
February 14, 2024

Hi @j_mas ,

 

I really appreciate your response, but I have a question: why does the percentage go beyond 100%? and when I tried to calculate in Excel, it did not give the same percentage as Excel.

 

J_Mas
J_MasAccepted solution
Level 5
February 15, 2024

Hi @j_mas ,

 

160 is the total number of hours in a month. We multiply 40 hours per week by four to get 160.


Ah, I see. I think you want to use 9600 instead of 160. It's my understanding that most time-related calculations in Workfront are done in minutes, not hours (even though the field says planned "hours"). So, 60 minutes * 160 hours = 9600.

Try this:

aggregator.displayformat=val
aggregator.function=SUM
aggregator.namekey=estCapacity Calc
aggregator.valueexpression=ROUND(DIV(SUM({workRequired}),9600)*100,2)
aggregator.valuefield=ROUND(DIV(SUM({workRequired}),9600)*100,2)
aggregator.valueformat=val
displayname=EST Capacity
textmode=true
valueexpression=ROUND(DIV(SUM({workRequired}),9600)*100,2)
valueformat=val