0% found this document useful (0 votes)
15 views5 pages

C) Creating Calculated Key Figures

The document outlines the process of creating calculated key figures for reporting, emphasizing the use of mathematical functions such as percentages and totals. It details how to define calculated key figures at both the InfoProvider and query levels, highlighting the differences in reusability and scope. Additionally, it lists various functions available for calculations, including percentage and data functions, along with guidelines for proper usage.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

C) Creating Calculated Key Figures

The document outlines the process of creating calculated key figures for reporting, emphasizing the use of mathematical functions such as percentages and totals. It details how to define calculated key figures at both the InfoProvider and query levels, highlighting the differences in reusability and scope. Additionally, it lists various functions available for calculations, including percentage and data functions, along with guidelines for proper usage.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

C) Creating Calculated Key Figures

Calculated Key Figures


Complicated calculations for information analysis are necessary in reporting. This requires various
mathematical functions such as percentage functions and totals functions.
You can take basic key figures, restricted key figures, or calculated key figures to define new calculated
key figures. For example, use the restricted key figures for two specific years to calculate the difference
between the net order amounts of the years in question.
You can define calculated key figures at InfoProvider level and at query level. If you create a calculated
key figure at InfoProvider level, you can use it in all queries that are based on the same InfoProvider.
At query level, the calculated key figure is valid only for the query in question.

Figure 4: Calculated Key Figures

Functions for Calculated Key Figures


The following functions are available as operators when you are defining a calculated key figure:
• Percentage functions

9
• Data functions
• Mathematical functions
• Trigonometric functions
• Boolean Operators

Percentage Functions
The following table describes most of the percentage functions that are available as operators for
calculated key figures.

Table 3: the available percentage functions


Function Formula Description

<Operand 1> Calculates the percentage variance of operand 1 from operand 2.


Percentage % Planned Net order amount % Actual Net order amount
Variance calculates the percentage by which the actual net order amount
<Operand 2> exceeds the planned sales volume.

<Operand 1> Calculates operand 1 as a percentage share of operand 2. Net


Percentage Share %A order amount % A Incoming Orders calculates the percentage
<Operand 2> share of net order amount that is made up of incoming orders.

Calculates how high the percentage share is in relation to the


result where result means the result of aggregation at the next
level (interim result).
Percentage Share %CT
of Result <Operand> %CT Incoming Orders calculates the share of incoming order
values of each individual characteristic value, for example, each
customer, in relation to the characteristic’s result, for example,
customer of a division.

Calculates how high the percentage share is in relation to the


overall result. The overall result means the result of aggregation
Percentage Share %GT at the highest level in the list.
of Overall Result <Operand>
Dynamic filters are included in the calculation of the overall
result.

Percentage Share This is similar to %GT. Unlike the process for calculating the
%RT
of the Report percentage share of the overall result, dynamic filters are not
<Operand>
Result included in the calculation of the report result.

The calculation always normalizes to the same value, irrespective


of the dynamic filter status and the navigational state.

10
Function Formula Description

Percentage Share
%XT Calculate the percentage based on the next total level on the X
of Results along
<Operand> axis.
the Columns

Percentage Share
%YT<Opera Calculate the percentage based on the next total level on the Y
of Results along
nd> axis.
the Row

Data
The following table describes the most important data functions that are available for calculated key
figures.

Table 4: the available data functions


Function Formula Description

Delivers the value 1 if the expression named in


COUNT
Counts <Expression> is not equal to 0. Otherwise, the function
(<Expression>)
delivers the value 0.

Delivers 0 if the expression named in <Expression>


gives a division by 0 in the calculation. Otherwise, the
NDIV0 (x): Is equal to 0 result is the value of the expression.
NDIV
with division by 0,
(<Expression>) This function is used to avoid the output of an error
otherwise x.
message or to continue calculating with a defined
result.

SUMCT Delivers the result of the operand in all rows or


Result
<Operand> columns.

SUMGT
Overall Result Delivers the overall result of the operand.
<Operand>

NODIM Returns purely numerical values of <expression> and


NODIM
<expression> suppresses units and currencies

SUMRT
Report Result Delivers the report result of the operand.
<Operand>

11
Note
Key figures always keep their units when a query is executed. This means that the formula is
semantically incorrect if you add a currency unit - for example, EUR, to a unit of weight, for
example, kg. If you want to calculate values without using units, use the Value Without
Dimension (NODIM) data function.

Mathematics
Mathematical functions that are available for calculated key figures include the following:
• Maximum
• Minimum
• Absolute value
• Smallest integer value larger than operand
• Division (integers)

Calculated Key Figures at the Query Level


To define calculated key figures at the query level:
• Include key figures needed for the calculation in the query definition.
• Choose New Formula from the context menu of the header of the key figure structure.
• As of SAP BW/4HANA 2.0 SP04, such a formula can be restricted in a further selection.
This restricted selection can only be used in the context of the current query, that means, it
cannot be saved as a reusable restricted key figure at InfoProvider level.

Calculated Key Figures at the InfoProvider Level


(Reusable Component)
When you create a calculated key figure at the InfoProvider level, you can reuse it in all queries that
are based on the same InfoProvider.
To define a calculated key figure at the InfoProvider level:
• In the InfoProvider tab: Reusable Components → Calculated Key Figures → New Calculated
Key Figure.
• Alternatively, in the Project Explorer tab: in the BW Repository, right-click the InfoProvider,
and select New → Calculated Key Figure.
• You can include basic key figures, restricted key figures, and calculated key figures that have
been defined at the InfoProvider level.
• Drag the calculated key figure to the section where it should be used, because it is not
automatically included in your query.
• You can reuse the calculated key figure in all queries on the same InfoProvider.
• Changes made later to the calculated key figure affect all queries in which it is used.

12
• You cannot Dereference the reused calculated key figure.

How to Define Calculated Key Figures


Launch the following demo to learn how to define calculated key figures at InfoProvider level and at
query level.

How to Use Data Function within a Calculated Key


Figure
In the following demo you will learn how to use a data function within a calculated key figure.

13

You might also like