Test Expressions
You can test expressions that you configure in the Expression Editor. When you test an expression, you enter sample data and then evaluate the expression.
You can test expressions when you configure expressions in the following ways:
- •In an output or variable port in the Expression transformation
- •In the Mapping Outputs view of an Expression transformation after adding the transformation to a mapping
For example, after configuring an expression that concatenates the first name, a space, and the last name, you can enter sample data for the ports, and then evaluate the expression to verify the result.
The following image shows the results of an expression that concatenates a sample first name and last name:
Date Format Strings for Sample Data
When you test an expression that uses a port with the Date/Time or Timestamp with Time Zone data type, you must enter sample data for the port using the required date format string.
To enter sample data for a port with the Date/Time data type, use the format MM/DD/YYYY HH24:MI:SS. When you evaluate the expression, the Expression Editor displays the result using the format that you specify in the expression. If you omit the format string in the expression, the Expression Editor displays the result using the same format MM/DD/YYYY HH24:MI:SS.
To enter sample data for a port with the Timestamp with Time Zone data type, use the format MM/DD/YYYY HH24:MI:SS TZR. When you evaluate the expression, the Expression Editor displays the result using the format YYYY-MM-DD HH24:MI:SS.NS TZR.
Testing an Expression
Test an expression in the Expression Editor to evaluate the expression and verify the result.
1. Open the Expression Editor in one of the following ways:
- - In an Expression transformation, click the Open button (
) in the Expression column for an output port or a variable port. - - Select an Expression transformation included in a mapping. In the Mapping Outputs view, click the Open button (
) in the Expression column for an output.
2. Configure the expression.
3. Click Test >> to open the testing panel.
4. Enter sample data for each field in the Test Values column.
You can enter test values for each port or parameter included in the expression.
5. Click Evaluate.
The expression result displays at the bottom of the testing panel.