Expression Rules
Expression rules use expression functions and columns to define rule logic. Create expression rules and add them to a profile in the Analyst tool.
Use expression rules to change or validate values for columns in a profile. You can create one or more expression rules to use in a profile. Expression functions are SQL-like functions used to transform source data. You can create expression rule logic with the following types of functions:
- •Character
- •Conversion
- •Data Cleansing
- •Date
- •Encoding
- •Financial
- •Numeric
- •Scientific
- •Special
- •Test
Expression Rules Process
Use the Profile wizard to create an expression rule and add it to a profile.
Use the expression editor to add expression functions, configure columns as input to the functions, validate the expression, and configure the return type, precision, and scale.
After creating and validating an expression rule, you can edit the precision value of the output rule column. By default, the precision value of the output rule column is set to 10. The precision value is truncated when the output rule column exceeds the set precision value.
The output of an expression rule is a virtual column that uses the name of the rule as the column name. The Analyst tool runs a column profile on the virtual column. For example, you use an expression rule to validate a ZIP code. The rule returns 1 if the ZIP code is valid and 0 if the ZIP code is not valid. Informatica Analyst runs a column profile on the 1 and 0 output values of the rule.
You can perform the following steps to create an expression rule:
- 1. Open a profile.
- 2. Configure the rule logic using expression functions and columns as parameters.
- 3. Configure the profiling options.
Creating an Expression Rule
Use the Profile wizard to create an expression rule and add it to a profile. Create an expression rule to validate values for columns in a profile.
1. Open a profile.
2. In the summary view, click Actions > Edit Profile to open the Profile wizard.
3. Click Specify Rules and Filters.
4. In the Rules pane, click Actions > Add a Rule.
The
New Rule dialog box appears.
5. In the New Rule dialog box, enter a name and an optional description for the rule. You can create a rule in the Functions panel or Columns panel.
6. To verify the rule, click Validate.
7. Optionally, choose to promote the rule as a reusable rule and configure the project and folder location. If you promote a rule to a reusable rule, you or other users can use the rule in another profile as a predefined rule.
8. Click OK.
The Specify Rules and Filters screen appears with the rule in the Rules pane.