Use the Expression Builder
There are two ways to add an expression, with different advantages:
-
Use the Expression Builder user interface. This more cumbersome process makes the transformations, validation checks, and custom listings that use it easier to copy and map in the new study.
-
Enter code as free text directly in the Expression Text field. This is a simpler process for a programmer but results in a less easily reusable transformation, validation check, or custom listing.
Important:
-
If you reference a static package or function in free text, you must select it in the Selected Packages tab.
-
In free text, use just the column name, not the table.column format, unless you need to use an alias, as in a self-join. In that case the alias.column format is required.
-
To use the Expression Builder:
-
In the Expression Criteria pane, select the following as needed to build the expression from left to right.
-
Add Group to add the parentheses () that surround a phrase in an expression or group smaller units of logic.
-
Add Item to add a unit of logic smaller than a group.
-
-
To add a phrase within a group, click the parentheses ().
To add a phrase outside a group, click Expression.
-
To add an item, in the Expression Item pane select Column, Function (for functions written by your company), or Standard Function (for Oracle SQL functions).
To create an expression using column values:
-
For Item Type, select Column.
-
Click the Select Column icon.
In the Select Column window, you can filter above any of the attribute columns to find the table column you want. Select a column and click OK.
-
If needed, select an operator from the list.
-
If needed, enter a data value. The system encloses the value you enter in single quotes.
-
If needed, select a conjunction from the list.
Tip:
If you select a conjunction within a group, it appears within the group, at the end. If you need a conjunction outside the group, click Expression above, then select the conjunction.
-
Click Add. The system generates the SQL expression and displays it in the Expression Text pane.
Note:
You can edit the generated code in the Expression Text pane, but if you do, you cannot continue to build the expression in the user interface.
Click Validate to check the generated code.
To use a function in your library:
-
For Item Type, select Function. The Select Function window appears, displaying a list of Oracle functions.
-
Select a function and click OK.
To use a standard SQL function:
-
For Item Type, select Standard Function.
-
Click the Select Standard Function icon. A search window appears. To filter, enter all or part of the name in the field above. You can use the wildcard
%
. -
Select a function and click OK.
-
-
Define additional groups and items to complete the expression as necessary.
-
Click Save.
-
Click Validate. The system validates the code and displays any errors or warnings.
To make a correction in the Expression Builder:
-
Select the faulty item in the Expression Criteria pane. An Update button appears in the Expression Item pane.
-
Make your changes in the Expression Item pane and click Update.
For more information, see the following sections.
-