In this section: How to: Reference: |
The Recap operation in the Financial Report Painter enables you to perform calculations on data in the rows of a report to produce new rows. Since these calculations are performed on rows, each row referenced in the calculation must be uniquely identified either by the default label assigned by Financial Report Painter or a label you assign to the row.
To initiate a Recap operation, you must supply the format of the value that will receive the result of the calculation, and an expression that defines the calculation you wish to perform. Initially, the default row label (R1, and so on) serves as the identifying label for the calculated value. However, it is good practice to provide a more descriptive label for reference in other calculations.
In the Financial Report Painter, you can type an expression directly into the RECAP dialog box or use a tabbed dialog box to formulate your expression.
Note: If you want to create a Recap row that summarizes the data in existing rows and does not require an expression, you can use a simple alternative procedure. For details, see How to Create a RECAP Summary Row.
In the Design matrix:
or
Right-click anywhere in a blank row (except on the label) and select Change Type to, and then Recap from the context menu.
The RECAP dialog box opens at the Options tab.
or
Click the Advanced button to expand the Recap Options tab, exposing features that will assist you in building an expression that may be composed of numbers and operators (numeric, alphanumeric, Boolean, and conditional), built-in functions, sort fields, and labels. The expression you create appears on the Options tab box as you make your selections. This process is described in steps 6 through 9.
For details about writing expressions, see the Creating Reporting Applications With Developer Studio manual.
You can also add parenthesis, single quotation marks, and designate uppercase and lowercase as required by clicking the buttons below the Expression window.
For details, see the Using Functions manual.
Tip: You can use a sort field value in a RECAP command to allow the model to take different actions within each major sort break. For example, in a request sorted by REGION, the following calculation would compute a non-zero value only for the EAST region:
IF REGION EQ 'EAST' THEN .25*CASH ELSE 0;
RECAP appears in the Row Type column of the matrix, along with the expression, label, and title you define.
Options Tab
Several options in this dialog box enable you to specify the column or columns to which you want to apply a Recap formula:
Identifies a single column that will contain the Recap formula. This is also the column in which the Recap output will appear on the report. You can choose the column from the drop-down list.
Indicates that the same Recap formula is to be used for all columns in the row. The Columns box is disabled when you select Apply to row.
Defines a range of columns to which the Recap formula is to be applied.
Indicates an interval of columns in the range that should have the Recap formula applied. For example, a value of 2 will apply the formula to every other column.
Note: Although not directly supported by options in the RECAP dialog box, there are a number of other ways in which you can identify the columns to which you want to apply the Recap calculation: column address, column value, and cell notation. To use these features, you must type the required syntax directly into the expression box in the RECAP dialog box.
For details, see Creating Financial Reports With Financial Modeling Language (FML).
Identifies the field type, field length, and display options that will be used for the Recap output. The field type can be alphanumeric, numeric, or date.
Opens the Format dialog box, which is designed to help you choose the format for your Recap output. See Format Dialog Box.
Displays the expression used to generate the Recap output.
Type the expression, or click the Advanced button to expand the Options tab, exposing features that will help you create the expression.
Expands the Options tab to make it easy to add functions, numbers, operators, labels, and sort fields to your expression. Your selections are reflected in the Expression box.
Provides numbers and operators that you can use to create numeric, alphanumeric, Boolean, and conditional expressions. Click the desired number or operator to add it to the formula in the Expression box.
Four additional buttons below the Expression box enable you to:
Parentheses affect the order in which WebFOCUS performs the specified operations.
For information on when to use parentheses in expressions, see the Creating Reporting Applications With Developer Studio manual.
Lists the labels (default or explicitly defined) that you can use in your expression. Select the label you want to add from the drop-down list. Your selection is added to the formula.
Lists the vertical sort (BY) fields that you can use in your expression. Select the fields you want to add from the drop-down list. Your selection is added to the formula.
Lists all available built-in functions that you can add to your expression. A function is a program that returns a value.
Select a function from the drop-down list. Then, in the Expression box, highlight each argument and substitute the value or field name you wish to use by typing or by selecting items from other drop-down lists. For details, see the Using Functions manual.
General Tab
Enables you to specify a title for the Recap calculation in which this title will appear on the report.
Lists the default label for the Recap row. You can replace the default row identification label with an explicit row label that you want to reference on the left hand side of an expression. You can think of this label as a calculated value or as a variable that holds the result of the Recap calculation. It can also be used as part of the expression in subsequent Recap formulas.
The following options apply to individual rows in the report. You can also apply these formatting options from the Row Properties check boxes above the matrix.
Creates a Recap expression for use in a calculation, but does not display its results on the report.
Posts the output of a Recap line to a work file. This line can then be used as though it were provided in a DATA row. For details, see Saving and Retrieving Intermediate Report Results.
The Format dialog box enables you to define the format of the output to be generated by a calculation.
Note: The Format button is available in the Compute, Define, and RECAP dialog boxes to define field formats for temporary fields and subtotal calculations. Click the Format button to open the Format dialog box.
The Format dialog box has the following fields and options:
Specifies the format of the current field. The field type can be alphanumeric, numeric, or date/time.
Opens the Date and Time Formats dialog box, where you can assign date and time formats, and apply date and time display options.
For more information, see the Creating Reporting Applications With Developer Studio manual.
Specifies the length, in characters, of a field. Enter a number in the Length box, or click the arrow buttons to specify a number.
Field Format |
Length |
---|---|
Alphanumeric |
1-4096 (default, 20) |
Floating Point |
1-9 (default, 7.2) |
Integer |
1-11 (default, 5) |
VarChar |
1-4096 (default, 20) |
Decimal |
20.18 (default, 12.2) |
Packed |
33.31 (default, 12.2) |
Dynamic |
Select a Format Field. |
Note: For numeric fields, include the decimal place in the length.
Specifies the number of decimal places to the right of the decimal point in a Decimal, Packed Decimal, or Floating Point field.
Check this option to display a minus sign to the right of negative numeric data.
Adds display options to numeric field formats to control how the field will appear on reports.
This example shows two RECAP expressions, with the second using values derived in the first.
The first RECAP expression calculates TOTCASH (as TOTAL CASH) by adding the values in rows 1 to 3. The results of the calculation will appear in all columns. This is designated using the Apply to Row check box on the RECAP Options tab. See RECAP Dialog Box.
The second RECAP expression calculates GROCASH, as CASH GROWTH (%):
The output is:
To create a row in which existing data in other rows is summarized:
Tip: Use this technique when the calculation you wish to perform is a simple addition of values that does not require an expression. For an illustration of this technique, see Emphasizing a Row Using Border Lines.
How to: |
RECAP expressions may be created in an FML matrix by dragging individual values from their original source cells and dropping them into a target cell in the same matrix. A valid source cell is any cell that contains numeric data, and a valid target cell is any cell that is either empty or contains only RECAP expressions. To create a RECAP expression, you can drag a value from any valid source cell, located in any row or column in an FML matrix, to any valid target cell in the same matrix. You should position a target cell in a section of your report, where data cells end and empty cells begin, at the end the rows or columns where the source cells are found.
To create a drag-and-drop RECAP expression:
While dragging the source cell contents, you should observe that a symbol, which appears as a circle with a slash through it, is displayed when your mouse pointer is hovering above cells where you are not allowed to drop the source cell value. When you reach a valid source cell in the matrix, the symbol will no longer appear.
By default, using a drag-and-drop operation to create a RECAP expression places a plus sign (+) between all values dragged into a RECAP cell.
WebFOCUS |