We use the following math-time expression: {00012} != null ? max({00012} - {00057}, 0) : null, where {00012} is code for Due date, and {00057} is code for Current date and time. To achieve this, the following functions are used: - Conditional operator ?: in order to avoid errors in the subtraction when Due date is not set. In this case we return
null , i.e., not initialized. - max() is used to avoid returning a negative duration when the Due date has passed.
We select duration as display format, since the numeric value being calculated, a number of milliseconds, represents a time duration. This way the value is represented like Time to Due Date: 2d 9h 43m instead of a single number. We also check parameter "Uninitialized when calculated value is zero", since we don't want the field to be shown once Due Date has been reached. |