Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Aggregate Storage and MDX Outline Formulas https://docs.oracle.com/cd/E57185_01/ESBTR/calc2mdx.

html

(//docs.oracle.com/en/)

Sign In (http://www.oracle.com/webapps/redirect/signon?nexturl=https://docs.oracle.com/cd/E57185_01/ESBTR/calc2mdx.html)
Home (/) / Applications (/en/applications/) / Oracle Enterprise Performance Management System Documentation, Release
11.1.2.4 (../index.htm) / Essbase (../nav/essbase.htm)

Technical Reference

Aggregate Storage and MDX Outline


Formulas
To write formulas for block storage outlines, Essbase provides a set of calculation functions and operators known
as the Calculator, or Calc, language. The Calculator language cannot be used to write member formulas for
aggregate storage databases. Formulas in aggregate storage outlines use the MDX language.

The following sections provide information for rewriting Calculator formulas in MDX for outlines that have been
migrated from block storage to aggregate storage. Before attempting to rewrite formulas you should be familiar
with the basic workings of aggregate storage outlines in Essbase. See the Oracle Essbase Database
Administrator's Guide, which discusses all aspects of aggregate storage.

Translating Calculator Functions to MDX Functions

When translating Calculator formulas to MDX, keep in mind the following differences between block storage
outlines and aggregate storage outlines:

The storage characteristics of a member and hence all its associated cells are defined in a block storage outline
through Dynamic Calc (and Dynamic Calc and Store) attributes, and stored attributes. Such attributes do not
exist in an aggregate storage outline. Upper level members along an explicitly tagged accounts dimension and
members with formulas attached to them are always calculated dynamically in such a database.

In block storage outlines, calculation order is dependent on the order in which members appear in the outline
whereas formulas are executed in order of their dependencies in aggregate storage outlines. In addition,
calculation order in the event of ambiguity in the evaluation of a cell, and two-pass calculation tags are not
required in an aggregate storage outline.

The layout of block storage outlines and the separation of dimensions into dense and sparse has an effect on
the semantics of certain calculations, giving rise to concepts such as top-down calculation mode, cell and block
calculation mode, and create-blocks on equations. The simplicity of the aggregate storage outlines, which do not
separate dimensions into dense and sparse, do not require such concepts.

General Guidelines for Translating Calculator Formulas to MDX

This section provides some general guidelines for translating Calculator formulas to MDX.

Be certain that the application has been redesigned to use an aggregate storage outline. In this regard, make
certain that formulas do not reference any block-storage specific outline constructs, such as variance functions that

1 of 6 02/10/2020, 12:47
Aggregate Storage and MDX Outline Formulas https://docs.oracle.com/cd/E57185_01/ESBTR/calc2mdx.html
rely on expense tagging, or functions that operate on shared members (for example, @RDESCENDANTS). Such
constructs are not valid in aggregate storage outlines.

Rewrite each function in the formulas attached to an explicitly tagged accounts dimension for which a direct
counterpart in MDX exists. Table 2 (calc2mdx.html#calc2mdx_1) provides specific information and examples. Then
identify functions for which an indirect rewrite is required. Table 2 (calc2mdx.html#calc2mdx_1) also provides information
and examples for these functions.

Understand the calculation order semantics for the formulas in the block storage outline. Organize the dependent
formulas in the aggregate storage outline carefully to achieve the same results as block storage.

If formulas reference custom-defined functions or macros consider rewriting them, if possible, using other MDX
functions.

The following table lists all functions in the Calculator language and their analogs in MDX (and vice versa). Where
a direct analog does not exist, transformation rules and examples are provided.

Table 2. Calculator to MDX Function Mapping

Calculator MDX Remarks/Examples

@ABS (abs.html) Abs (mdx_abs.html) Calculator

@ABS(Actual-Budget)

MDX

Abs([Actual]-[Budget])

@ALLANCESTORS Ancestors (mdx_ancestors.html) Shared members are not relevant


(allancestors.html) to aggregate storage outlines.

@ALIAS (alias.html) Not required. In MDX, the argument to @ALIAS


can be passed as-is to the outer
function.

@ANCEST (ancest.html) Ancestor (mdx_ancestor.html) with Calculator


CurrentMember @ANCEST(Product,2,Sales)
(mdx_currentmember.html) as input.
Use a tuple to combine the result MDX
with the optional third argument to
( Sales, Ancestor(
the @ANCEST function.
Product.CurrentMember,
Product.Generations(2) ) )

2 of 6 02/10/2020, 12:47
Aggregate Storage and MDX Outline Formulas https://docs.oracle.com/cd/E57185_01/ESBTR/calc2mdx.html

Calculator MDX Remarks/Examples

@ANCESTORS (ancestors.html) Ancestors (mdx_ancestors.html) Calculator


@ANCESTORS("New York")

MDX
Ancestors([New
York].parent,
[Market].levels(2))

@ANCESTVAL (ancestval.html) Ancestor (mdx_ancestor.html) with Calculator


CurrentMember @ANCESTVAL(Product,2,Sales)
(mdx_currentmember.html) as input.
Use a tuple to combine the result MDX
with the optional third argument to
(Sales, Ancestor(
the @ANCESTVAL function.
Product.CurrentMember,
Product.Generations(2) )
).Value

@ATTRIBUTE (attribute.html) Attribute (mdx_attribute.html) Calculator

@ATTRIBUTE(Can)

MDX

Attribute([Can])

@ATTRIBUTEBVAL [BaseDim] See About MDX Properties


(attributebval.html) .CurrentMember.AttributeDim (mdx_properties.html) .Calculator

@ATTRIBUTEBVAL(Caffeinated)

MDX
Product.CurrentMember.Caffeinated

@ATTRIBUTESVAL [BaseDim] See About MDX Properties


(attributesval.html) .CurrentMember.AttributeDim (mdx_properties.html) .Calculator

@ATTRIBUTESVAL("Pkg Type")

MDX
Product.CurrentMember.[Pkg
Type]

3 of 6 02/10/2020, 12:47
Aggregate Storage and MDX Outline Formulas https://docs.oracle.com/cd/E57185_01/ESBTR/calc2mdx.html

Calculator MDX Remarks/Examples

@ATTRIBUTEVAL (attributeval.html) [BaseDim] .CurrentMember See About MDX Properties


AttributeDim (mdx_properties.html) .Calculator

@ATTRIBUTEVAL(Ounces)

MDX
Product.CurrentMember.Ounces

@AVG (avg.html) If the dimensionality of all Note that the MDX Avg function
elements in the input set to @AVG skips missing cell values by
is the same, use Avg (mdx_avg.html) default.
. Translate SKIPNONE to
INCLUDEEMPTY. Calculator

If the dimensionality of all @AVG(SKIPMISSING,


elements in the input set to @AVG @CHILDREN(East))
is not the same, then perform
average by explicitly adding the MDX
tuples and dividing by the set
cardinality (the number of tuples in
Avg([East].Children)
the set).

If SKIPMISSING is replaced by
SKIPNONE, the translation
changes to:

Avg([East].Children,
Sales, INCLUDEEMPTY)

For SKIPZERO, the translation is:

Avg([East].Children,
IIF(Market.CurrentMember.Value=0,
Missing,
IIF(Market.CurrentMember=
Missing,0,
Market.CurrentMember.Value
) ) )

For SKIPBOTH, the translation is:

Avg([East].Children,
IIF(Market.CurrentMember=0,
Missing,
Market.CurrentMember.Value)
)

4 of 6 02/10/2020, 12:47
Aggregate Storage and MDX Outline Formulas https://docs.oracle.com/cd/E57185_01/ESBTR/calc2mdx.html

Calculator MDX Remarks/Examples

@AVGRANGE (avgrange.html) CrossJoin (mdx_crossjoin.html) (first Calculator


argument, set created out of
second argument). The rest is
@AVGRANGE(SKIPMISSING,
similar to @AVG when the
Sales, @CHILDREN(West))
dimensionality of all elements of
the input set is identical.
MDX

Avg(CrossJoin({Sales},
{[West].Children)})

If SKIPMISSING is replaced by
SKIPNONE, the translation
becomes:

Avg({[West].Children)},Sales,INCLUDE

If SKIPZERO is used, then the


translation is:

Avg([West].Children),
IIF(Sales = 0, Missing,
IIF(Sales = Missing, 0,
Sales) ) )

@CHILDREN (children.html) Children (mdx_children.html) Calculator

@CHILDREN(Market)

MDX

Children(Market)

or

Market.Children

@CONCATENATE (concatenate.html) Concat (mdx_concat.html) Calculator

@MEMBER(@CONCATENATE("Qtr1",
"1"));

MDX

Concat("01", "01")

5 of 6 02/10/2020, 12:47
Aggregate Storage and MDX Outline Formulas https://docs.oracle.com/cd/E57185_01/ESBTR/calc2mdx.html

Page 991 of 1363


(https://docs.oracle.com/cd/E57185_01/ESBTR/mdx_query_limits.html)
(https://docs.oracle.com/cd/E57185_01/ESBTR/mdx_func_return_value.html)

(#)

About Oracle (http://www.oracle.com/corporate/index.html) Contact Us (http://www.oracle.com/us/corporate/contact/index.html) Legal Notices (http://www.oracle.com/us/legal

/index.html) Terms of Use (http://www.oracle.com/us/legal/terms/index.html) Your Privacy Rights (http://www.oracle.com/us/legal/privacy/index.html) | Cookie Preferences (#) |

Ad Choices (https://www.oracle.com/legal/privacy/marketing-cloud-data-cloud-privacy-policy.html#12)
Copyright © 2020, Oracle and/or its affiliates. (http://www.oracle.com/pls/topic/lookup?ctx=cpyr&id=en)

6 of 6 02/10/2020, 12:47

You might also like