Show TOC

Aggregation and Special ValuesLocate this document in the navigation structure

Use

The aggregation rules outlined in the previous sections produce unique results for value sets with valid values. There are also more complex value sets that contain special values such as 0, NULL , or DIV0.

The following example shows that a value set of this kind does not lead to a unique result based on the previous rules.

Example

V8 = { (R2D2, 28 €) (Palpatine, 0€), (Boba, NULL), (Ackbar, 122$), (Jabba, DIV0) }

AVG(V8) = ???

Note

In Customizing, you can set how you want special values to be displayed in the query result. You can find more information in the SAP Implementation Guide under Start of the navigation path SAP Customizing Implementation Guide Next navigation step SAP NetWeaver Next navigation step Business Warehouse Next navigation step Settings for Reporting and Analysis Next navigation step General Settings for Reporting and Analysis Next navigation step Displaying Special Values in a Query Result End of the navigation path.

The following section explains the different combinations for exception aggregation rules (AVG, AV0, and so on) and special value sets (for example, { 0€ }, { 0€, DIV0 }, { 42€, 13$ }, { 0€, DIV0, 42€, 13$ } ) and the results that they produce. Firstly, the special behavior and results of the standard and exception aggregations for basis key figures are described as well as for calculated and restricted key figures (known as formula exception aggregation). These aggregation rules are then compared with different value sets that contain the values which appear in the special situations (for example, ERROR or mixed currencies).

There are the following types of special values that have to be included in value sets:

  1. ERROR: This special value is the result of an incorrect calculation, such as, division by 0 (DIV0).

  2. NOP: This special value is the result of the aggrgation rules NO1, NO2, and NOP. An aggregation could not be executed.

  3. *: This symbol represnts a valid value.

  4. NULL: This special value means that there are no values.

The order of this list corresponds to the priority with which the OLAP processor includes the special values in an aggregation: Firstly ERROR, then NOP, then *, and finally NULL.

Special value NOP is handled like ERROR so that the following rules apply:

  • An aggregation that returns the special value ERROR for the set {*, NULL, ERROR}, also returns the special value NOP for the set {*, NULL, NOP} , however it returns the special value ERROR for the set {*, NULL, NOP, ERROR}.

  • An aggregation that does not return the special value ERROR for the set {*, NULL, ERROR}, also does not return the special value NOP for the set {*, NULL, NOP}. Examples of this are the aggregation rules CN0, AV0, FIRST, LAST, and CNT.

The following tables apply the priority rules to some example sets (in the columns) and show the different aggregation rules (in the rows). For the sake of charity, the characteristic names are left out of the example sets. The special exception rules AV1, average (weighted with number of days), and AV2, average (weighted with number of working day; factory calendar) are not displayed: As the displayed value sets do not reference the time characteristics, AV1 and AV2 behave like AVG. (For hierarchy exception aggregations NHA and NGA, seeHierarchy Exception Aggregation NGA and NHA).

B={ NULL }

C={ 0€ }

D={ DIV0 }

E={ 42€ }

F={ 0€, DIV0 }

G={ 0€, 13$ }

AVG

NULL

0 €

DIV0

42 €

DIV0

6,5 $

AV0

NULL

0 €

NULL

42 €

0 €

13 $

CNT

0

1

1

1

2

2

CN0

0

0

0

1

0

1

FIR

NULL

0 €

DIV0

42 €

0 €

0 €

LAS

NULL

0 €

DIV0

42 €

DIV0

13 $

MAX

NULL

0 €

DIV0

42 €

DIV0

13 $

MIN

NULL

0 €

DIV0

42 €

DIV0

0 €

NO1

NULL

0 €

DIV0

42 €

DIV0

NOP

NO2

NULL

0 €

DIV0

42 €

DIV0

NOP

NOP

NULL

0 €

DIV0

42 €

DIV0

13 $

STD

NULL

0 €

DIV0

0

DIV0

9,192 $

SUM

NULL

0 €

DIV0

42 €

DIV0

13 $

VAR

NULL

0

DIV0

0

DIV0

84,5

H={DIV0, 42€ }

I={ 42€, 13$ }

J={ 42€, -13$ }

K={ 0€, DIV0, 13$ }

L={ 0€, 42€, 13$ }

AVG

DIV0

*

*

DIV0

*

AV0

42 €

*

*

13 $

*

CNT

2

2

2

3

3

CN0

1

2

2

1

2

FIR

DIV0

42 €

42 €

0 €

0 €

LAS

42 €

13 $

- 13 $

13 $

13 $

MAX

DIV0

*

42 €

DIV0

*

MIN

DIV0

*

- 13 $

DIV0

0 €

NO1

DIV0

NOP

NOP

DIV0

NOP

NO2

DIV0

NOP

NOP

DIV0

NOP

NOP

DIV0

NOP

NOP

DIV0

NOP

STD

DIV0

*

*

DIV0

*

SUM

DIV0

*

*

DIV0

*

VAR

DIV0

*

*

DIV0

*

M={ NOP }

N={ 0€, NOP }

O={ NOP, 13$ }

P={ DIV0, NOP, 13$ }

AVG

NOP

NOP

NOP

DIV0

AV0

NULL

NULL

13 $

13 $

CNT

1

2

2

3

CN0

0

0

1

1

FIR

NOP

0 €

NOP

DIV0

LAS

NOP

NOP

13 $

13 $

MAX

NOP

NOP

NOP

DIV0

MIN

NOP

NOP

NOP

DIV0

NO1

NOP

NOP

NOP

DIV0

NO2

NOP

NOP

NOP

DIV0

NOP

NOP

NOP

NOP

DIV0

STD

NOP

NOP

NOP

DIV0

SUM

NOP

NOP

NOP

DIV0

VAR

NOP

NOP

NOP

DIV0