Row calculations create summary rows in a report. You can use summary rows to calculate the sum of data across a range of rows or to calculate an arithmetic expression composed of simple mathematical operators.
Table 97 lists row calculation commands:
Table 97. Report Writer Commands: Row Calculations
Report Command | Description |
---|
CALCULATE ROW | Create a row and associate it with a row name or label. This process is similar to declaring a variable. You can also perform simple calculations with CALCULATE ROW. For more complex calculations, use SETROWOP. See also OFFROWCALCS and ONROWCALCS. |
OFFROWCALCS | Temporarily disable row calculations in the report. See also CALCULATE ROW and ONROWCALCS. |
ONROWCALCS | Re-enable calculations after using OFFROWCALCS. See also CALCULATE ROW and OFFROWCALCS. |
SETROWOP | Define complex calculations for the row specified in CALCULATE ROW. SETROWOP defines a calculation operator to be applied to all subsequent output data rows. You can display the calculation results in the newly created row with the PRINTROW command. |
PRINTROW | Immediately display the row specified in CALCULATE ROW to the report. |
CLEARROWCALC | Reset the value of the calculated row to #MISSING. See also CLEARALLROWCALC. |
CLEARALLROWCALC | Reset the value of all calculated rows after using the CLEARROWCALC command. |
SAVEROW | Create a calculated row with captured data. See also SAVEANDOUTPUT. |
SAVEANDOUTPUT | Capture data and output the result after using the SAVEROW command. |
Commands that designate columns must use valid data column numbers, as determined by the original order of the columns.
Precede and follow all operators in an expression with a single space.
Essbase does not support nested (parenthetical) expressions.
Essbase supports integer and floating-point constants in expressions as single entries or members of an array.
The CALCULATE ROW command can specify an operation (+, -, *, /, or OFF) as an equation consisting of constants, other calculated rows, and operators. Equations are evaluated at the time of declaration. Member names are not supported in expressions with the CALCULATE ROW command.
If you specify an operator, the operator applies to subsequent output rows and stores the result in the calculated row. Specifying an operator is useful for aggregating a series of rows to obtain a subtotal or total. To reset the operator, use SETROWOP. If the CALCULATE ROW command does not specify either an equation or an operator, the + operator is assumed.
The CALCULATE ROW command supports the standard mathematical operations.
Example report script:
{ CALC ROW "Total Sales" = "Sales..Group1"
+ "Sales..Group2" }
The example creates “Total Sales” based on two other calculated rows.