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. If there are no values for the selected resource type, the Field drop-down list will remain disabled.
The Resources drop-down list always begins with four system entries: Report Fields, Calculated Fields, RW Legends and System Variables. These are followed by the name of each table associated with the current report. If a table name is selected, each field in that table will be listed in the Field drop-down list. The following describes each system entry, and what appears in the Field drop-down list if that entry is selected.
Report Fields 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. Use the Report Field Options window to change a field’s display type.
Calculated Fields fills the Field drop-down list with all calculated fields the current calculated field can reference. Under special circumstances, dependencies can be created between calculated fields that prevent them from being referenced by the current calculated field. Refer to Evaluation order for more information.
RW Legends 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 statement. When you click Add, a dialog box will appear, prompting you to enter an index value indicating which legend value to use. The legend will be added to the expression you’re creating.
A legend is passed into the calculated field as a string. If you need the legend value to have some other storage type, you will need to use one of the system-defined functions to convert the legend value. System-defined functions are described in System-defined functions.
Often, legends are used in a calculated field to specify the array index of an array field. The following procedure describes how to use a legend to specify the array index in a calculated field.
For example, Quarterly Bonuses in an array field that has four array elements. The bonus amount for each quarter is stored in an element of the array. To show this value on your report, you would need to create a calculated field similar to the following:
The value you passed to the first legend will specify which array element value to display. If the value 1 is passed to the first legend, the first quarter’s bonus value is displayed. If the value 2 is passed to the legend, the second quarter’s value is displayed, and so on.
Globals populates the Field drop-down list with all of the fields declared as global variables in the current dictionary.