View: calculate time and date differences
You can calculate the difference between the following:
- The time and date difference between two date fields on the same object
- The time and date difference between a field on an object and another field on the parent object
Access requirements
You must have the following access to perform the steps in this article:
table 0-row-2 1-row-2 2-row-2 3-row-2 layout-auto html-authored no-header | |
---|---|
۶Ƶ Workfront plan | Any |
۶Ƶ Workfront license |
New:
Or Current:
|
Access level configurations |
Edit access to Reports, Dashboards, Calendars to modify a report Edit access to Filters, Views, Groupings to modify a view |
Object permissions | Manage permissions to a report |
For more detail about the information in this table, see Access requirements in Workfront documentation.
Calculate the time and date difference between two date fields on the same object
For example, you can calculate the difference between the Planned Completion Date and the Actual Completion Date of a task.
-
Go to a list of tasks.
-
From the View drop-down menu, click New View.
-
Click Add Column and start typing “Planned Completion Date” in the Show in this column field then select it when it displays in the list.
-
Click Add Column and start typing “Actual Completion Date” in the Show in this column field then select it when it displays in the list.
-
Click Add Column, then click Switch to Text Mode.
-
Hover over the text mode area, and click Click to edit text.
-
Remove the text you find in the Text Mode box, and replace it with the following code:
code language-none displayname=Planned-Actual Completion Date linkedname=direct querysort=plannedCompletionDate textmode=true valueexpression=ROUND(DATEDIFF({plannedCompletionDate},{actualCompletionDate}),2) valueformat=HTML
-
Click Save, then Save View.
Calculate the time and date difference between the field on an object and another field on a parent object
For a list of objects and their parents, see the “Understanding the Interdependency and Hierarchy of Objects” section in Understand objects in ۶Ƶ Workfront.
For example, you can calculate the difference between the Planned Completion Date of a task and the Planned Completion Date of its parent task, or of the project that the task is on.
-
Go to a list of tasks.
-
From the View drop-down menu, click New View.
-
Click Add Column and start typing " Project Planned Completion Date" or “Parent Completion Date” in the Show in this column field then select it when it displays in the list.
-
Click Add Column and start typing “Planned Completion Date” in the Show in this column field then select it when it displays in the list.
-
Click Add Column, then click Switch to Text Mode > Edit Text Mode.
-
Remove the text you find in the Edit Text Mode box, and replace it with one of the following codes:
-
To display the difference between the Planned Completion Date of the project and that of the task:
code language-none displayname=Project Planned Completion - Task Planned Completion (Days) textmode=true valueexpression=ROUND(DATEDIFF({project}.{plannedCompletionDate},{plannedCompletionDate}),2) valueformat=HTML
-
To display the difference between the Planned Completion Date of the parent task and that of the task:
code language-none valueexpression=ROUND(DATEDIFF({parent}.{plannedCompletionDate},{plannedCompletionDate}),2) textmode=true<br>valueformat=HTML displayname=Parent Planned Completion - Planned Completion (Days)
-
-
Click Done, then Save View.