Create ADDDAYS, ADDWEEKDAY, ADDMONTHS, ADDYEARS expressions

In this video, you will learn:

  • What the ADDDAYS/ADDWEEKDAY/ADDMONTHS/ADDYEAR expressions calculate
  • How to create an ADDWEEKDAYS data expression in a calculated field
Transcript
In this video, you’ll learn what the ADDDAYS, ADDWEEKDAYS, ADDMONTHS, and ADDYEARS expressions calculate, and how to create an ADDWEEKDAYS data expression in a calculated field.
The ADDDAYS, ADDWEEKDAYS, ADDMONTHS, and ADDYEAR expressions allow you to add a certain number of calendar days, weekdays, months or years to an existing data field. For instance, requests submitted to the creative service team have a 14-day turnaround time. However, each request has an SLA attached, it needs to be reviewed within three days of the day the request was entered into Workfront. So to capture the SLA review due date, the ADDWEEKDAYS or ADDDAYS expression can be used within a calculated field.
These expressions typically include three things, the name of the expression, in this case ADDWEEKDAYS, and two data points, typically a start or completion date and the number of days, months, or years to add to that date. First, consider if you want the calendar dates, which would include weekends.
For this example, we’re going to use weekdays to focus on the working days specified by the default schedule created in Workfront. Once that’s decided, you can start building the expression.
We’re going to use the SLA review due date as an example.
So in the custom form select Calculated in the field options, fill in the label instructions if needed, and format fields. Note, because this field just focusing on what date the task will be due, which includes the review, the format should be a date.
Once you’re ready to start building your expression, start by searching for the expression in the expression search box.
When found, click it to add it to the calculation box. At this point, we need to put in our data points so the expression knows what information to use in order to calculate the due date. In this example, we’re going to start with the day the request was entered into Workfront also known as the entry date. Go to the field search box, and start typing the name of the field.
When it appears in the list, click on it to put it in the calculation box. You’ll notice the system automatically starts adding the necessary formatting to make the calculation work in Workfront. If this were the sole data point you needed for the expression, you’d save it and move forward.
However, there are other data points needed for this calculation.
In this example, we need to add the SLA review timeframe, three days to the predetermined 14-day turnaround time.
Since it’s simply a number, in this example, all we need to do is add a comma and the number three to our expression.
For more information on calculation structure, see the Learn the data expression structure tutorial.
Once done, save the field and the custom form.
At this point the calculated field can be used in different ways, like a view or a custom report to view or group the results. The ADDDAYS, ADDWEEKDAYS, ADDMONTHS, and ADDYEARS expressions not only allow you to create a more accurate timeframe for due dates, but grant your teams the ability to collaborate better and automate workflows within Workfront. -

Additional examples

Below are a few additional ADDDAYS/ADDWEEKDAY/ADDMONTHS/ADDYEAR expressions Adobe Workfront customers have created.

Should have been done by

The customer wanted to know when the task should have been completed based on the Actual Start Date and the Planned Duration. The Projected Completion Date won’t work in this case because it can move if the task is late, and the Planned Completion Date doesn’t help if there are delays in prior tasks.

The expression created was ADDDAYS({actualStartDate},{durationMinutes}/480)

Time in the Duration field is stored in minutes. So in this expression, the Duration field cannot stand alone if the time is to be reflected in days. For that to happen, the Duration has to be divided by 480 minutes (480 minutes = 8 hours = 1 Day)

This is why the second value slot contains (Duration/480).

Invoice completion date

This example includes not only uses the ADDDAYS expression but a custom field previsouly created and saved in the custom form.

The customer is capturing the date an invoice is submitted through a custom date field titled “Invoice Submission Date”.

Once submitted, the invoice must be completed and filed within 30 days. To automatically produce that completion and filing date, an ADDDAYS calculated field is used along with the “Invoice Submisison Date” custom field. The expression looks like this:

ADDDAYS({DE:Invoice Submission Date},30)

recommendation-more-help
c9fbcf61-6d19-481e-a9ab-f54a0ae0ee8a