Calculating Values for Date/Time and Numeric Fields

Field calculations for transitions provide a way to collect metrics using Date/Time and Numeric fields. For example, you could calculate how long Help Desk calls wait before a Support representative begins working the issue, or calculate interest values based on the current date.

The Set to calculation option appears when you select a Date/Time or Numeric field on the Field Overrides tab of the transition Property Editor.

To calculate values for Date/Time and Numeric fields:

  1. In App Explorer, select the workflow containing the transition.
  2. In the workflow editor, select the transition for which you want a Date/Time or Numeric field to perform a calculation.
  3. In the transition Property Editor, select the Field Overrides tab, and select the Override field properties for 'field name' option.
  4. Optionally, click Arranged by, and select a different sort order for the list of fields.
  5. In the field list, select the Date/Time or Numeric field for which you want to define the calculation to be performed.
  6. In the Value options area, select the Set to calculation option.
  7. Do one of the following:
    • Select Field from the Operand 1 menu, and then select a field from the drop-down list or a keyword from the date/time tool. You cannot select the field being edited or a field that could cause a recursive calculation. For a Date/Time field, see Date/Time Fields for a description of your options for populating this field.
      CAUTION:
      The "(Auto)" string is not supported as a default value for Date/Time fields.
    • Select Value from the Operand 1 menu, and then enter a constant value in the adjacent text box.
    Tip: Calculations do not work for system date fields (Submit Date/Time, Close Date/Time, Last State Change Date, Last Modified Date) in a transition calculation for which the date will be calculated. Instead, use the "Now" keyword, which gives you the same calculation.
  8. Select an operator from the Operator drop-down list.

    The list contains only valid operators for this field and the current operand. If you change the operand, the operator list is updated with the appropriate choices. If you select an operator that is not valid with the operand, the operator changes, usually to None. (The None operator is useful if you want to transfer the value of another field to this field during the transition.)

  9. If you select an operator other than None, you can specify a second operand from the Operand 2 menu. This list offers the same options and constraints as the first.
  10. From the Perform calculation list, specify whether the calculation should be performed before the transition form opens, after it is submitted, or both.
  11. From the Empty operand fields list, specify how the transition should treat empty operands:
    • Are Invalid: Select this option to require users to provide values for fields used as operands. The transition cannot be completed if values are not provided.
    • Skip Calculation: Select this option to let users complete the transition without providing values for fields used as operands. The calculation is simply skipped if values are not provided.
    • Treat as Zero: Select this option to perform the calculation using zeros in place of any unprovided values for fields used as operands.
  12. For Numeric fields and Date/Time fields with the Elapsed time option enabled, select the Add calculation to current value check box to add the result of the calculation to the current value of the field. Use this option to increment the current value or to calculate the total of the calculation and the current value.

About Operand Fields and Operator Selection Lists

The following table lists the valid choices for the operand fields and operator selection lists for a Numeric or Date/Time field using the calculation feature. The valid choices are based on the type of transition field being edited.
Field Type

1st Operand Constant

1st Operand Field Types

Operators

2nd Operand Constant

2nd Operand Field Types

Elapsed Time Elapsed Time Elapsed Time None, +, – Elapsed Time Elapsed Time
Elapsed Time Elapsed Time Elapsed Time *, Truncating /, Rounding / Float Numeric Int, Single Select, Summation
Elapsed Time Elapsed Time Elapsed Time Truncating *, Rounding *, Truncating /, Rounding / Float Numeric Float
Elapsed Time Date/Time Date/Time Date/Time Date/Time, Date
Elapsed Time (not applicable) Date Date/Time Date/Time, Date
Date/Time Date/Time Date/Time None, +, – Elapsed Time Elapsed Time
Date/Time (not applicable) Date None, + Elapsed Time Elapsed Time, Time
Date/Time (not applicable) Date Elapsed Time Elapsed Time
Date Date Date/Time, Date None, Truncating +, Rounding +, Truncating –, Rounding – Elapsed Time Elapsed Time
Time Time Time None, +, – Elapsed Time Elapsed Time
Time (not applicable) Date/Time None (assigns time portion of date/time) (not applicable) (not applicable)
Numeric Int Int Numeric Int, Single Select, Summation None, +, –, *, Truncating /, (integer math), Rounding / Int Numeric Int, Single Select, Summation
Numeric Int Int Numeric Int, Single Select, Summation Truncating +, Truncating –, Truncating *, Truncating /, Rounding +, Rounding –, Rounding *, Rounding / Float Numeric Float
Numeric Int Float Numeric Float Truncating +, Truncating –, Truncating *, Truncating /, Rounding +, Rounding –, Rounding *, Rounding / Int or Float Numeric Int/Float, Single Select, Summation
Numeric Float Int or Float Numeric Int/Float, Single Select, Summation None, +, –, *, / Int or Float Numeric Int/Float, Single Select, Summation
Numeric Float Int or Float Numeric Int/Float, Single Select, Summation * (not applicable) Elapsed Time (converted to hours)