Inserting Formulas in Row Blocks 
The Define Row Formula dialog box appears.
The text that you want to appear in the report row for the formula.
A formula

You defined two multi-dimension sets for row blocks 1 and 2. You want to define a row containing the difference between the highest totals of the row blocks. In line 3, you enter the formula 001 - 002 .
Number of the row block that you want to use as the representative row block to define the column structure of a formula row. The active column blocks of the representative row block determine the column structure of the formula row.
The representative row block must be a set and must be entered as an operand in the formula.
If you do not make an entry in this field, the system automatically determines the representative row block. If you make an incorrect entry in this field, the system automatically corrects the entry.

The Report Writer automatically assigns a summation level to the formula row. This level is calculated from the highest total of the rows used in the formula plus one.
For example, you defined two single-dimension sets for row blocks 1 and 2. You defined an additional row containing the grand total of the highest totals of the row blocks, using the formula 001 + 002 in line 3 of the row definition. The highest summation levels of the sets used in row blocks one and two are 3 and 2 respectively. The Report Writer automatically assigned summation level 4 to the formula row (using the highest summation level of the row block totals (3) plus one).
When building a formula, you can use the operators in the table in Using Set Formulas in Report Writer .
Within a row formula you can use various operands.

Beginning with Release 3.0C, the syntax used to enter formula operands has changed. You now enter formula operands in the form nnn (for example, 001 to enter the row block 001). In releases prior to Release 3.0C, you enter formula operands using angle brackets around the operand (for example <001> ).
The system automatically converts any existing formulas into the new format. You do not therefore need to change your sets or reports that contain formulas.
You can use the following operands in row formulas:
·
Line numbers in the form nnn (for example 001 for line 001)·
Value variables (for example, &PERIOD for the value variable PERIOD)·
Symbolic names for cells (for example, TOTAL for a specific totals row in a report)Within a formula you can also use:
·
Absolute values (for example, 10 or 20 )·
Combinations of absolute values and line numbers, for example, 10 * 002·
Boolean LogicThe following rules apply to formulas:
·
Operands for formulas use the value of the highest sum of the row set. (The value at level 1 of the set.) If you use negative values when defining your levels for a set characteristic, the system cannot process the formula.·
If a report contains more than one row block, the resulting formula columns will have the lowest number of columns defined for the row blocks.
Row block one contains 5 columns. Row block two contains 3 columns. The row formula is 001 + 002. The results of the formula will be presented in 3 columns.
·
When processing a report for which print classes are defined, the result of the formula uses the highest defined print class, except when the print class is zero. Print class 0 takes priority over the other print classes.
Report row one uses print class 5 and row two uses print class 3. When you define a formula to calculate the total of the two rows, the result of the formula uses print class 5.
·
When processing a report that contains both row formulas and column formulas, the system processes the column formula at the point of intersection.·
If a row block is suppressed, the row block can still be used in formula processing; however, the row block data is not displayed in the report output. If you want to highlight the row formula total, select Highlight row.
Enter a code for the color in which you want to display the row formula total.
Set the Lower border indicators depending on how you want the lower border for the row formula totals to appear. You can define the lower border so that no lower border appears, a single line appears, a double line appears, or a user-defined character is used for the border.
Set the Upper border indicators depending on how you want the upper border for the row formula totals to appear. You can define the upper border so that no upper border appears, a single line appears, a double line appears, or a user-defined character is used for the border.
The formula appears on the Create Report: Rows screen.

You can enter a formula that refers directly to the result of another formula line.
Example:
Your report contains the following rows:
You enter this total using the formula
You enter this row using the formula
The operand 003 in this formula refers to the result of the formula calculated for row block 3.