How to: |
Reference: |
The RECAP command enables you to perform calculations on data in the rows of the report to produce new rows. You must supply the name and format of the value that results from the calculation, and an expression that defines the calculation you wish to perform. Since RECAP calculations are performed among rows, each row in the calculation must be uniquely identified. FML supplies default row labels for this purpose (R1, R2, and so on). However, you may assign more meaningful labels. For more information, see Referring to Rows in Calculations.
RECAP calcname[/format]=expression; [AS 'text']
where:
Is the required command name. It should begin on a line by itself.
Is the name you assign to the calculated value. The name can be up to 66 characters long, and must start with an alphabetic character. This name also serves as an explicit label. For more information, see Referring to Rows in Calculations.
Is the USAGE format of the calculated value. It cannot exceed the column width. The default is the format of the column in which the calculated value is displayed.
Can be any calculation available with the DEFINE command (including IF ... THEN ... ELSE syntax, functions, excluding DECODE and EDIT, and fields in date format). The expression may extend to as many lines as it requires. A semicolon is required at the end of the expression. For more information, see Using Functions in RECAP Calculations and the TIBCO WebFOCUS® Using Functions manual.
The expression can include references to specific rows using the default FML positional labels (R1, R2, and so on), or it can refer to rows, columns, and cells using a variety of flexible notation techniques. Note that Rn references can only be used for rows previously evaluated within the model. For more information, see Referring to Rows in Calculations, Referring to Columns in Calculations, and Referring to Cells in Calculations.
Changes the default title of the row. By default, the name of the RECAP value is displayed as the row title in output. The AS phrase replaces the default. Enclose the text in single quotation marks.
RECAP TOTVAL/D6.2S=IF R1 GT R4 THEN R4 ELSE R1; AS 'REDUCED VALUE'
TOTVAL/D6.2S displays the result as six positions with two decimal places (and displays blanks if the value was zero) in each column of the report, regardless of the format of the data in the column. This feature can be used to display percentages in a column of whole numbers.