Duration Variables

The Duration Ruleset variable type can be used to calculate the time between two DateTime variable types, or used to increment/decrement a DateTime value. You can safely manipulate duration values in your data without the need for manual editing or custom rules.

In conjunction with this variable type, several new Actions are available in the Ruleset to support the Duration type.

Action Description
CreateDuration This task creates a Duration variable to be used with a DateTime variable.
CalculateDuration This task calculates the time between two DateTime variables.
DurationEquals This task checks to see if two Duration variables are equal and returns a boolean result.
AddDurationtoDateTime This task adds to or increments Duration from the DateTime value.
SubtractDurationFromDateTime This task subtracts or decrements Duration from the DateTime value.
Note: Ruleset Actions provides additional details for these and other Actions.

Creating a Duration Variable

These steps take place in the Ruleset editor's Variables section.
  1. Click Add Variable.
  2. Type the name you wish to give the variable.
  3. Select Duration from the Type drop-down.
  4. Click OK to complete this task.

Result: The new variable (shown as ) now appears as an option in the Variables pane.

Example

This Ruleset example shows four Composite Rules using the Duration variable type and several supporting Actions.

Each Composite Rule is working with a common DateTime variable having these values.

Composite Rule #1

Composite Rule #2

Composite Rule #3

Composite Rule #4