
Maintaining Calculated Key Figures
You maintain the calculated key figures in an aspect in the EC-EIS application menu under Information system
® Key figures ® Maintain. To create or change a key figure, proceed as follows. 
Formula |
Description |
REVEN - COST |
Normal subtraction |
REVEN MAX COST |
Maximum of REVEN and COST |
REVEN %A COST |
COST as percentage of REVEN |
REVEN + ABS (COST) |
Sum of REVEN and the absolute COST amount |
Using the function Extras
® Basic fields ® Display, you can display the possible components for the formula. Using the function Switch basic fields, you can switch between basic key figures, existing key figures and constants. For more information on constants, see Creating Constants.The following operators are supported in the formula:
Operator |
Description |
+, -, *, / |
Basic arithmetic operations |
% |
Percentage variance (i.e. a % b = 100 * (a-b) / abs(b)) |
%A |
Percentage (a %A b = 100* a/b) |
%T |
Percentage of the total sum 1 |
%S |
Percentage of the sum |
** |
Raise to a power |
= |
Assignment |
ABS |
Absolute amount |
CNT |
1 if operand <> 0, otherwise 0 |
COS |
Cosine |
DIV |
Division (of integers) |
DTA |
Jump function. 1 if operand is 0, otherwise 0 |
EXP |
Exponential function |
LOG |
Logarithm |
MAX |
Maximum |
MX0 |
Maximum of operand and zero |
MIN |
Minimum |
MN0 |
Minimum of operand and zero |
MOD |
Remainder (of division of integers) |
NDI |
Key figure value without dimension |
REF |
Value 1 without dimension 2 |
SIN |
Sine |
SQT |
Square root |
Key:
Choose Edit
® Edit formula to delete and insert lines in the formula area. 
Key figure formulas may be up to 4,096 bytes long. Note that key figures in the info system are broken down internally.
Before saving the formula, you must choose Edit
® Check formula. The formula is then checked for correct syntax, the formula stages are generated, and the technical attributes are set to default values. The formula stages represent the breakdown of the key figure formula into elementary calculation steps (stages). After the syntax check, the key figures are checked for their logical sense. A check is made, for example, that quantities are not added to values.You can use the function Edit
® Reset formula to reset the key figure to the version stored in the database or the last saved version.Choose Edit
® Substitute formula to replace the key figures with the elements defining them until the formula contains only basic key figures and constants.Choose Extras
® Get formula(s) to display or hide the formulas for the key figures in the lower section of the formula area. You can specify the key figures by entering the name or subgroup.Use the function Extras
® Switchover paging to switch between the upper and lower formula areas.Choose Extras
® Check recursive act. to check whether recursive relationships exist between key figures.Extras
® EIS stage forms is for internal test purposes only.The function Extras
® Evaluate formula(s) acts as a calculator. You can enter values in the basic fields (Enter basic values) and then have the system calculate the key figure values from the formulas (Calculate key fig.). The system displays the calculated values on the formula stage screen (Goto ® Formula stages). You may have to switch between the value and attribute display (Extras ® Values/Attributes).Choose the function Formula stages to branch to another screen. Here, the calculation stages for the key figure are displayed. In addition, you can set the time-based and non-time-based aggregation rules, the time reference field, the No aggregation required indicator and the number format (number of decimal places and display factor).
Aggregation of key figures
An attribute of key figures, important for their use in presentation, is the aggregation rule assigned to the key figures. This determines if and how the individual key figures are to be aggregated over characteristics in a report. There are two types of aggregation for basic key figures:
You can maintain a non-time-based and a time-based aggregation rule for each key figure.

Basic key figure
Field name |
Description |
Aggregation |
Time-based aggr. |
Ref. field |
EMPLY |
No. of employees |
SUM |
AVG |
&PERI |
The number of employees must be posted each month (
This basic key figure is then used in a basic report.
Period |
No. of employees |
|
001.1995 |
10 |
|
002.1995 |
15 |
|
003.1995 |
35 |
|
Result |
20 |
(Average value) |
If you drill down period 2 by cost center, the list appears as follows:
Cost center |
No. of employees |
|
010 |
5 |
|
020 |
7 |
|
030 |
3 |
|
Result |
15 |
(Total) |
The following functions are available for time-based aggregation:
Function |
Description |
AVG |
Average |
CNT |
Counter |
FIR |
First value |
LAS |
Last value |
MAX |
Maximum |
MIN |
Minimum |
NOP |
No aggregation |
SC+ |
Summation where > 0 |
SC- |
Summation where < 0 |
STD |
Standard deviation |
SUM |
Summation |
VAR |
Variance |
The following functions are available for non-time-based aggregation:
Function |
Description |
MAX |
Maximum |
MIN |
Minimum |
NOP |
No aggregation |
SC+ |
Summation where > 0 |
SC- |
Summation where < 0 |
SUM |
Summation |
Reference field for time-based aggregation
If you define a time-based aggregation rule other than
SUM for a key figure, you must maintain a time reference field. This must be a valid characteristic of type D as well as being the smallest unit of time in the aspect (You can use the variable &PERI delivered by SAP which represents the fiscal year and the period.) The time reference field must be the most precise time field in the aspect. According to this rule, the field Posting date would supersede Fiscal year .All key figures in a report must have the same time reference field.

Where a basic key figure has a time-based aggregation rule other than
No aggregation required
Set the No aggregation required indicator if the key figure cannot be aggregated in a report from the rows or columns before it. For example, sales revenue per employee for all plants cannot be calculated from the relevant key figures for the individual plants, but rather must be calculated using the cumulated revenue and the total of all employees. The collective key figure must be calculated in the results row on the basis of a new formula.

Month |
Sales |
Employees |
Sales/Employee |
Plant 1 |
100 |
1000 |
0,1 |
Plant 2 |
1000 |
100 |
10 |
Result |
1100 |
1100 |
10.1 or 1? |
In the above example, it is important that the results row is not calculated like the other rows (sales divided by employees) but that it is calculated using a formula defined for the cell.
The No aggregation required indicator must be set when
Key Figure Groups
You can create key figure groups and assign key figures to these groups You can use these key figure groups in the report definition in order to simplify the selection of key figures. Before you assign a key figure to a key figure group during key figure maintenance, you must first have created key figure groups in Customizing.