You are here: Building Expressions > Expression Builder

Expression Builder

Analyzer’s Expression Builder helps you easily build expressions. An expression can be a combination of fields, functions, constants, variables and operators. Expressions range from simple QUANTITY * COST to complex SUBSTRING(UPPER(Name),1,3)+STRING(Salary,5).

Instead of typing, you can click to select fields, functions, variables and operators. Click the [From Table] drop-down list to display fields from a related table. Expressions appear in the Expression text box with a scroll bar to display long expressions.

After constructing an expression, you can validate it by clicking [Validate]. You can save your expression by typing a name in the Save As text box and clicking [OK].

From Table Drop-Down List

The Expression Builder lists fields from the current table or from any related files displayed in the From Table drop-down list. If there are no related files, only fields from the current file are listed. When you select the file whose fields you want to use, Analyzer displays the available fields for that file in the Available Fields list View.

Available Fields List View

The Expression Builder lists all defined fields from the selected table in the Available Fields list View, including both data fields and computed fields (named expressions). The Category field in the Available Fields list View indicates whether the field contains character data (C), numeric data (N) or a date (D).

You can build expressions or filters with fields from related files, even if those fields do not appear in your current View. You can also build filters with fields from related files and see the results in your View, whether or not you add those related fields to your View.

Field names from related files use the format tablename.fieldname to indicate the source of the data. For example, customer.name shows that the field “name” came from the table “customer.”

Save As Text Box

If you want to save your expression, enter a name in the Save As text box and click [OK]. Analyzer displays named expressions in the Available Fields list View.

Keypad

The Expression Builder keypad (located in the center of the Expression Builder dialog) contains operators that tell Analyzer how to evaluate the expression.

Filters List Box

All named filters from the selected table layout are displayed in the Filters list box and can be used to build expressions. Filters let you limit the records to which a command applies, based on whether or not a condition is true.

Variables List Box

All variables that you can use in building expressions are displayed in the Variables list box. In most cases, variables are created by Analyzer commands and hold temporary values for the duration of an Analyzer session.

Functions

By default, all functions are listed in the Functions list box. To display a subset of functions, click the Functions drop-down list and choose a category from the list. Functions are a convenient shorthand for performing standard computational tasks.

You do not have to memorize the parameters required for each function. If you are accessing the functions from the Expression Builder, simply check the Paste Parameters checkbox before selecting the function. When you select the function, the text box displays the function name and a description of its parameters.

Note: Optional parameters are enclosed in angle brackets (< >).

For more information about functions, see Functions.

Using the Expression Builder

Operators

How Expressions are Evaluated

Expressions - Examples

Specifying Literal or Constant Values

Fixed-point Arithmetic