WebFOCUS Online Help > Managed Reporting Developer > Creating Graphs With Advanced Graph Assistant > Creating Temporary Fields
In this section: How to: |
A temporary field is a field whose value is not stored in the data source, but can be calculated from the data that is there, or assigned an absolute value. When you create a temporary field, you determine its value by writing an expression. You can combine fields, constants, and operators in an expression to produce a single value. For example, if your data contains salary and deduction amounts, you can calculate the ratio of deductions to salaries using the following expression: deduction / salary.
You can specify the expression yourself, or you can use one of the many supplied functions that perform specific calculations or manipulations. In addition, you can use expressions and functions as building blocks for more complex expressions, as well as use one temporary field to evaluate another.
There are two types of temporary fields—a virtual field and a calculated value—which differ in how they are evaluated:
You can create temporary fields from the Field selection tab.
The Field Creator dialog box opens.
If you are familiar with coding Compute and Define expressions, you can type the expression in the text box. Otherwise, you can use the key pad to assist you in creating the expression. To use the key pad:
If you select a function, enter the values for the function arguments. See the Using Functions manual for complete information on functions.
New calculated values (Compute) are added to the Y-axis dimension in the query pane.
New virtual (Define) fields are added to the fields list in the Data selection pane, where you can select them as if they were real fields.
Note: When you create a defined field, if you want that field value to be blank, the blank must be contained in quotation marks.
The following image shows the Field format options dialog box, which you use to assign a format to a temporary field. Refer to the following procedures for the step-by-step instructions.
or
Click the down arrow next to the Compute button and select Edit compute.
The Field Creator dialog box opens.
The Field format options dialog box opens.
The new alphanumeric format is now effective for the selected temporary field.
or
Click the down arrow next to the Compute button and select Edit compute.
The Field Creator dialog box opens.
The Field format options dialog box opens.
If the selected field matches the selected format type, its current length appears in the Total length box. Otherwise, the default length appears in the Total length box. The Decimal box shows the number of decimal places for Floating Point, Decimal, and Packed fields.
The new numeric format is now effective for the selected temporary field.
or
Click the down arrow next to the Compute button and select Edit compute.
The Field Creator dialog box opens.
The Field format options dialog box opens.
You can add a percent sign to the end of a numeric value (Decimal, Integer, Floating Point format types). This numeric display option includes a percent sign along with the numeric data, but does not calculate the percent.
or
Click the down arrow next to the Compute button and select Edit compute.
The Field Creator dialog box opens.
The Field format options dialog box opens.
The percent sign is now added to the selected temporary field.
The following table consists of a Format column for each numeric format, a Data column for its actual data value, and a Display column for how it appears.
Format |
Data |
Display |
---|---|---|
I2% |
21 |
21% |
D7% |
97 |
97% |
F3.2% |
48 |
48.00% |
WebFOCUS |