Build a Calculated Attribute that Calculates the Duration to include Non Working Days
search cancel

Build a Calculated Attribute that Calculates the Duration to include Non Working Days

book

Article ID: 113771

calendar_today

Updated On:

Products

Clarity PPM SaaS Clarity 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:

  1. In Clarity, go to Administration->Objects->Tasks->Attributes
  2. Click New
  3. Enter an Attribute Name and Attribute ID
  4. Change the Data Type from 'String' to 'Calculated'
  5. Check 'Presence Required' to have the attribute automatically display in both Create and Edit view of the tasks
  6. Check 'Include in the Data Warehouse' if applicable
  7. Click Save
  8. Click the '[Build Calculated Attribute] link that now appears next to 'Calculation'
  9. For Function, select DateDiff
  10. For Argument 1, select Start (prstart) from the Attribute Name (ID) drop down
  11. For Argument 2, select Finish (prfinish) from the Attribute Name (ID) drop down
  12. Click the 'Generate' button
  13. 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.