Build a Calculated Attribute that Calculates the Duration to include Non Working Days
book
Article ID: 113771
calendar_today
Updated On:
Products
Clarity PPM SaaSClarity PPM On Premise
Issue/Introduction
This article provides the steps on how to build an attribute that calculations duration to include non working days and can be used as a basis for help in creating other calculated attributes, which can be useful to customers look for a way around the design behavior of the out of the box Duration field that is calculated based on the base calendar and does not take into account the resource assignment calendar.
Resolution
Below are the steps on how to create a calculated attribute:
In Clarity, go to Administration->Objects->Tasks->Attributes
Click New
Enter an Attribute Name and Attribute ID
Change the Data Type from 'String' to 'Calculated'
Check 'Presence Required' to have the attribute automatically display in both Create and Edit view of the tasks
Check 'Include in the Data Warehouse' if applicable
Click Save
Click the '[Build Calculated Attribute] link that now appears next to 'Calculation'
For Function, select DateDiff
For Argument 1, select Start (prstart) from the Attribute Name (ID) drop down
For Argument 2, select Finish (prfinish) from the Attribute Name (ID) drop down
Click the 'Generate' button
The following should appear in the Expression field: DateDiff(prstart,prfinish,"").
Note: If you leave the expression as is the custom duration attribute will not count the first day in the duration (example if the Start date of the task is 9/13/18 and the Finish Date is 9/13/18, the custom duration attribute will be calculated as 0, so to have the additional day included in the calculations:
Change the Expression from DateDiff(prstart,prfinish,"") to DateDiff(prstart,prfinish,"")+1 (The +1 will add an 1 day into the calculated duration)
14. Click Validate 15. Click Save and Return
You should now have the attribute available in the Task properties. It can also be added to the Gantt or Task list views as well.