Using the Expression Builder

The Expression Builder of the Conditional Router stage allows you to create an expression that must evaluate to true for an input record to be routed to the output port of the stage.
  1. Each parent group comprises of a desired conditional combination of child expressions and child groups.
  2. Each expression consists of a left operand, a right operand and a logical operator.
  3. Each group must specify whether all or any of its constituent conditions must hold true for the entire group to evaluate to true.

To build an expression using the Expression Builder:

  1. In the Expression Editor, select the option Expression created with Expression Builder.
    By default, the Expression Builder option is selected and a parent group is displayed in the expression hierarchy tree on the left of the Expression Builder section.
  2. To add a child group within the selected group, click Add Group .
    This newly added group gets added as a child of the parent group, and is selected in the tree by default. Within each group, you can add child expressions and child groups.
  3. For each group, select either All true or Any true under the Combine expression method header.
    • All true: The group evaluates to true only if all the child criteria of the group hold true.
    • Any true: The group evaluates to true if even one of its child criteria hold true.
  4. To add a child expression within the selected group, click Add Expression.
    The newly added expression gets added as a child of the parent group and is selected in the tree by default.

    To define this child expression:

    1. Specify the left operand of the selected expression using the Field dropdown to select any one of the columns in the input file.
    2. Specify the logical operator connecting the two components of the selected expression by selecting the appropriate operator from the Operator field as explained below:
      Table 1. Expression Builder Operators
      Operator Description

      Is Equal

      Checks if the value in the field matches the value or field specified.

      Is Not Equal

      Checks if the value in the field does not match the value or field specified.

      Is Null

      Checks if the field is a null value.

      Is Not Null

      Checks if the field is not a null value.

      Is Empty

      Checks if the field is null or a string with a length of 0.

      Note: This operation is only available for fields with a data type of string.

      Is Not Empty

      Checks if the field is neither null nor a string with a length of 0.

      Note: This operation is only available for fields with a data type of string.

      Is Less Than

      Checks if the field has a numeric value that is less than the value specified. This operator works on numeric data types as well as string fields that contain numbers.

      Note: This operation is not available for fields with a data type of Boolean.

      Is Less Than Or Equal To

      Checks if the field has a numeric value that is less than or equal to the value specified. This operator works on numeric data types as well as string fields that contain numbers.

      Note: This operation is not available for fields with a data type of Boolean.

      Is Greater Than

      Checks if the field has a numeric value that is greater than the value specified. This operator works on numeric data types as well as string fields that contain numbers.

      Note: This operation is not available for fields with a data type of Boolean.

      Is Greater Than Or Equal To

      Checks if the field has a numeric value that is greater than or equal to the value specified. This operator works on numeric data types as well as string fields that contain numbers.

      Note: This operation is not available for fields with a data type of Boolean.

      Starts With

      Checks if the field begins with the characters specified.

      Note: This operation is only available for fields with a data type of string.

      Does Not Start With

      Checks if the field does not begin with the characters specified.

      Note: This operation is only available for fields with a data type of string.

      Contains

      Checks if the field contains the string specified.

      Note: This operation is only available for fields with a data type of string.

      Does Not Contain

      Checks if the field does not contain the string specified.

      Note: This operation is only available for fields with a data type of string.

      Ends With

      Checks if the field ends with the characters specified.

      Note: This operation is only available for fields with a data type of string.

      Does Not End With

      Checks if the field ends with the characters specified.

      Note: This operation is only available for fields with a data type of string.

      Matches Regular Expression

      Matches the field with a regular expression for identifying strings of text of interest, such as particular characters, words, or patterns of characters. The value field should contain a valid regular expression pattern.

      Note: This operation is only available for fields with a data type of string.
    3. Specify the right operand of the selected expression by selecting either Value or Field.
      • Value: The left operand of the selected expression is compared to this value.
      • Field: The left operand of the selected expression is compared to this column of the same input file. Select the right operand column from the dropdown.
  5. To add a sibling expression or sibling group to any entity, select that entity in the tree and click Add Expression or Add Group respectively.
  6. To shift a child expression or child group from one parent group to a different parent group, drag it to the desired parent group header in the criteria tree on the left.
  7. Repeat the above steps to add as many child expressions and child groups as are required to create the desired final expression criteria.
  8. Click OK.
The Condition/Expression column in the Conditional Router Options window displays the defined expression criteria, which must evaluate to true for a record to be written to the stage's corresponding output port.