Allows you to enter the name of the calculated field, up to 79 characters.
Allows you to specify whether the expression in the Calculated Expression field or in the True Case and False Case fields will have a string, integer, currency, variable currency or date storage type.
If you select Integer as the result type, the calculated expression's result will actually be a long integer. If you wish to use the calculated field with a function in another calculated field, be sure to select a function that's compatible with long integer storage types.
If you select Currency as the result type, the calculated field's result will always be a 10-byte currency value.
Allows you to specify whether the calculated field you're creating will contain a calculated expression or a conditional expression.
A conditional expression is a boolean expression used to print one of two results in a calculated field. If the expression is true, the result of the expression entered in the True Case field will be printed; if the expression is false, the False Case result will be printed. A calculated expression displays the results of the expression itself in the calculated field.
Fields on the Fields tab allow you to select a field and add it to the calculated expression.
The Fields tab contains two drop-down lists: Resources and Field. Once a resource is selected, the Field drop-down list is enabled, displaying all available choices of the selected resource type. When you have chosen a field, click Add to add it to the expression. If there are no values for the selected resource type, the Field drop-down list will remain disabled.
The Resources drop-down list contains four system entries, followed by the name of each table associated with the current report. Each is described below:
Fills the Field drop-down list with all fields on the report that have modified display types (fields for which the Report Field Options window has been used to change the field's display type from Data to some other type, such as Count). The display type, or an abbreviation of the type, is listed first, followed by the name of the field to which it was applied.
Fills the Field drop-down list with all calculated fields for the current report that were created prior to the current calculated field. A calculated field can never reference another calculated field that was created after it was, even if you reopen the field after the new one has been created.
Fills the Field drop-down list with one selection: Legend. Selecting this value allows you to use one of the values passed to the report through the legends clause of the run report or run report with name statements. Click the highlighted text below for a detailed procedure that describes how to use legends with arrays in calculated fields.
Fills the Field drop-down list with all of the fields declared as system variables in the current dictionary.
Populates the Field drop-down list with the name of each field in the specified table. Only tables attached to the current report are listed.
Fields on the Constants tab allow you to define a constant and add it to the calculated expression.
Typically, constants are used in the True Case and False Case fields, or as a value against which fields are measured in the expression. This tab contains two fields: the Type drop-down list and the Constant field.
Allows you to specify the storage type of the constant you're entering in the expression: Integer, Currency, String, Date or Time. The value you are allowed to enter in the Constant field depends upon the constant type selected. For example, if you select Integer as the constant type, you will be able to enter only numeric values in the Constant field.
Allows you to specify a constant, such as numbers or text, that will be entered in the condition, true case, false case or calculated expression.
When you have defined both the type and the constant, click Add to place the constant in the expression.
Fields on the Functions tab allow you to select a system-defined or user-defined function and add it to the calculated expression.
If System-Defined is selected, the Function drop-down list will appear, allowing you to choose one of 14 predefined functions. If User-Defined is selected, two drop-down lists will appear, Core and Function. To select a function you've created, you must first select the core with which the function is associated. You can then select the desired user-defined function from the Function drop-down list.
Allows you to enter choose a function to insert into an expression. Each function should be entered in the expression before the field it will affect; for instance to use the STRIP function to remove trailing and leading blanks, enter STRIP, then the field from which you'll remove blanks. The field will automatically be placed in parentheses.
Refer to the following topics for more information:
Allows you to specify the relationships between fields and constants in expressions. Some operators will be dimmed and unavailable, depending upon whether you're creating a calculated or conditional expression. Refer to the following topic for a complete description of each operator:
Allows you to specify when the calculated field will be evaluated. The calculated field being defined will be evaluated after the calculated field you select. This drop-down list will contain the names of the other calculated fields for the report. Some calculated fields won’t appear in this list if known dependencies exclude them as valid choices. When you specify a field with the Evaluate After drop-down list, you are creating a dependency between the two calculated fields.
The Evaluate After drop-down list also contains the choice <any>. This is the default for a new calculated field. Choose <any> when the order in which the calculated field is evaluated isn’t significant. Choosing <any> also makes the calculated field available for use in as many other calculated fields as possible.
This field appears if you chose Calculated as the expression type. It allows you to enter the expression, such as a mathematical calculation or a concatenation of text fields, that will determine the value printed in the calculated field. You can't edit this field directly; rather, construct the expression using selections from the Fields, Constants and Functions tabs, and add the appropriate operators. Scroll arrows can be used to view all portions of a lengthy expression. To preview the expression, click on the field's prompt; the Calculated Expression window will appear. Click OK to return to the Calculated Field Definition window.
This field appears if you chose Conditional as the expression type. It allows you to enter the condition whose result determines whether the true case or the false case will be printed in the calculated field. You can't edit this field directly; rather, construct the expression using selections from the Fields, Constants and Functions tabs, and add the appropriate operators. Scroll arrows can be used to view all portions of a lengthy expression. To preview the expression, click on the field's prompt; the Calculated Expression window will appear. Click OK to return to the Calculated Field Definition window.
These fields are available if you chose Conditional as the expression type. They allow you to enter the results you want printed in the calculated field if the condition entered in the Conditional Expression field exists (True Case) or doesn't exist (False Case) for a given set of data. You can't edit these fields directly; rather, make entries using selections from the Fields, Constants and Functions tabs, and add the appropriate operators. Scroll arrows can be used to view all portions of lengthy expressions. To preview the expression, click on the field's prompt; the Calculated Expression window will appear. Click OK to return to the Calculated Field Definition window.
You must place values in both the True Case and False Case fields when you write conditional expressions.