How Dynamic Calculation Changes Calculation Order

Dynamic Calc optimizes batch calculation performance, and changes the order in which Essbase calculates values. Sparse dimensions are calculated first. Take precautions when using Dynamic Calc in asymmetric data sets or with Two Pass members.

Using dynamically calculated data values changes the order in which Essbase calculates the values, and can have implications for how you administer the cube.

Calculation Order for Dynamic Calculation

When you use Dynamic Calc, Essbase calculates values of sparse dimensions first, and then dense. Dense values are calculated in the order of accounts, time, time series, other dense dimensions, and finally, attributes.

When Essbase dynamically calculates data values, it calculates the data in an order different from the batch database calculation order.

During batch calculations, Essbase calculates the database in the following order:

  1. Dimension tagged as accounts

  2. Dimension tagged as time

  3. Other dense dimensions (in the order in which they appear in the database outline)

  4. Other sparse dimensions (in the order in which they appear in the database outline)

  5. Two-pass calculations

See Defining Calculation Order.

For dynamically calculated values, on retrieval, Essbase calculates the values by calculating the database in the following order:

  1. Sparse dimensions

    • If the dimension tagged as time is sparse and the database outline uses time series data, Essbase bases the sparse calculation on the time dimension.

    • Otherwise, Essbase bases the calculation on the dimension that it normally uses for a batch calculation.

  2. Dense dimensions

    1. Dimension tagged as accounts, if dense

    2. Dimension tagged as time, if dense

    3. Time series calculations

    4. Remaining dense dimensions

    5. Two-pass calculations

    6. Attributes

If your data retrieval uses attribute members, the last step in the calculation order is the summation of the attributes. Attribute calculation performs on-the-fly aggregation on data blocks that match the attribute members specified in the query. When the query contains two-pass calculation members, attribute calculation applies the two-pass calculation member formula after all the aggregated values are collected. This two-pass calculation uses the data values from the attribute calculation, not the values in a real data block.

The use of attribute members in your query causes Essbase to disregard the value of the Time Balance member in the dynamic calculations. During retrievals that do not use attributes, the value of the Time Balance member is applied to the calculations. The difference in calculation procedure between the use and nonuse of attribute members generates different results for any upper-level time members that are dynamically calculated.

During retrievals that do not use attributes, these dynamically calculated members are calculated in the last step and, therefore, apply the time balance functionality properly. However, during retrievals that do use attributes, the summation of the attribute is the last step applied. The difference in calculation order produces two different, predictable results for upper-level time members that are dynamically calculated.

Calculation Order for Dynamically Calculating Two-Pass Members

Dynamic Calc changes the order in which Essbase calculates values. Take precautions when using Dynamic Calc with Two Pass members.

Consider the following information to ensure that Essbase produces the required calculation result when it dynamically calculates data values for members tagged as two-pass (see Using Two-Pass Calculation).

If multiple Dynamic Calc dense dimension member are tagged as two-pass, Essbase performs the dynamic calculation in the first pass, and then calculates the two-pass members in this order:

  1. Two-pass members in the accounts dimension, if any exist

  2. Two-pass members in the time dimension, if any exist

  3. Two-pass members in the remaining dense dimensions in the order in which the dimensions appear in the outline

For example, in the Sample.Basic database, assume the following:

  • Margin% in the dense Measures dimension (the dimension tagged as accounts) is tagged as Dynamic Calc and two-pass.

  • Variance in the dense Scenario dimension is tagged as Dynamic Calc and two-pass.

Essbase calculates the accounts dimension member first. So, Essbase calculates Margin% (from the Measures dimension) and then calculates Variance (from the Scenario dimension).

If Scenario is a sparse dimension, Essbase calculates Variance first, following the regular calculation order for dynamic calculations. Essbase then calculates Margin%. See Calculation Order for Dynamic Calculation.

This calculation order does not produce the required result, because Essbase needs to calculate Margin % -> Variance using the formula on Margin %, and not the formula on Variance. You can avoid this problem by making Scenario a dense dimension. This problem does not occur if the Measures dimension (the accounts dimension) is sparse, because Essbase still calculates Margin% first.

Calculation Order for Asymmetric Data

Essbase Dynamic Calc may not be suitable for use with asymmetric data sets. Review the examples in this topic against your use case.

Because the calculation order of Dynamic Calc differs from that of batch calculations, in some cube outlines, you may get different calculation results if you tag certain members as Dynamic Calc. These differences happen when Essbase dynamically calculates asymmetric data.

Symmetric data calculations produce the same results no matter which dimension is calculated.

Using the data set in the symmetric example below, the calculation for Qtr1-> Profit produces the same result whether you calculate along the dimension tagged as time or the dimension tagged as accounts. Calculating along the time dimension, add the values for Jan, Feb, and Mar:

50+100+150=300 

Calculating along the accounts dimension, subtract Qtr1 -> COGS from Qtr1 -> Sales:

600–300=300 

Table 22-1 Example of a Symmetric Calculation

Time -> Accounts Jan Feb Mar Qtr1

Sales

100

200

300

600

COGS

50

100

150

300

Profit (Sales – COGS)

50

100

150

300

Asymmetric data calculations calculate differently along different dimensions.

Using the data set in the asymmetric example below, the calculation for East -> Sales produces the correct result when you calculate along the Market dimension, but produces an incorrect result when you calculate along the accounts dimension. Calculating along the Market dimension, adding the values for New York, Florida, and Connecticut produces the correct results:

50 + 100 + 100 = 250

Calculating along the accounts dimension, multiplying the value East -> Price by the value East -> UnitsSold produces incorrect results:

15 * 50 = 750

Table 22-2 Example of an Asymmetric Calculation

Market -> Accounts New York Florida Connecticut East

UnitsSold

10

20

20

50

Price

5

5

5

15

Sales (Price * UnitsSold)

50

100

100

250

In the following outline, East is a sparse dimension, and Accounts is a dense dimension:


This image shows an outline in which East is a sparse dimension, and Accounts is a dense dimension.

If East and Sales are tagged as Dynamic Calc, Essbase calculates a different result than it does if East and Sales are not tagged as Dynamic Calc.

If East and Sales are not Dynamic Calc members, Essbase produces the correct result by calculating these dimensions:

  1. Dense Accounts dimension—calculating the values for UnitsSold, Price, and Sales for New York, Florida, and Connecticut

  2. Sparse East dimension—aggregating the calculated values for UnitsSold, Price, and Sales for New York, Florida, and Connecticut to obtain the Sales values for East

If East and Sales are Dynamic Calc members, Essbase produces an incorrect result by calculating these dimensions:

  1. Sparse East dimension—aggregating the values for UnitsSold, Price, and Sales for New York, Florida, and Connecticut to obtain the values for East

  2. Values for East -> Sales—taking the aggregated values in the East data blocks and performing a formula calculation with these values to obtain the value for Sales

To avoid this problem and ensure that you obtain the required results, do not tag the Sales member as Dynamic Calc.

Solve Order in Hybrid Mode

Solve order in Essbase determines the order in which dynamic calculation executes in hybrid mode. You can customize the solve order or accept the default, which is optimized for high performance and dependency analysis.

The concept of solve order applies to dynamic calculation execution, whether initiated by a dynamic member formula or a dynamic dependency in a calculation script. When a cell is evaluated in a multidimensional query, the order in which the calculations should be resolved may be ambiguous, unless solve order is specified to indicate the required calculation priority.

You can set solve order for dimensions or members, or you can use the default Essbase solve order. The minimum solve order you can set is 0, and the maximum is 127. A higher solve order means the member is calculated later; for example, a member with a solve order of 1 is solved before a member with a solve order of 2.

When hybrid mode is enabled, the default solve order (also known as calculation order) closely matches that of block storage databases:

Dimension/Member Type Default Solve Order Value
Stored members 0
Sparse Dimension Members 10
Dense Account dimension members 30
Dense Time dimension members 40
Dense regular dimension members 50
Attribute dimension members 90
Two pass dynamic members 100
MDX calculated members or named sets (defined in MDX With) 120

In summary, the default solve order in hybrid mode dictates that stored members are calculated before dynamic calc members, and sparse dimensions are calculated before dense dimensions, in the order in which they appear in the outline (top to bottom).

Dynamic members (with or without formulas) that do not have a specified solve order inherit the solve order of their dimension, unless they are tagged as two pass.

Two-pass calculation is a setting you can apply, in block storage mode, to members with formulas that must be calculated twice to produce the correct value. Two pass is not applicable in hybrid mode, and any members tagged as two pass are calculated last, after attributes. In hybrid mode, you should implement a custom solve order, instead of two pass, if the default solve order does not meet your requirements.

The default solve order in hybrid mode is optimized for these scenarios:

  • Forward references, in which a dynamic member formula references a member that comes later in the outline order. There is no outline order dependency in hybrid mode.

  • Aggregation of child values based on outline order more closely matches aggregation using equivalent formulas.

  • Dynamic dense members as dependencies inside sparse formulas. In hybrid mode, if a sparse formula references a dense dynamic member, the reference is ignored, because sparse dimensions are calculated first. To change this, assign a solve order to the sparse dimension that is higher than (calculated later than) the dense dimension’s solve order.

Customizing the Solve Order

If you need to adjust the behavior of dynamic calculations in hybrid mode, customizing the solve order of dimensions and members helps you achieve it without making major changes to the outline.

If you implement a custom solve order, it overrides the default solve order. If members or dimensions have equal solve order, the order in which they appear in the outline (top to bottom) resolves the conflict.

Unless you customize a solve order for certain members, the top dimension member's solve order applies for all dynamic members in the dimension.

To change the solve order, use the outline editor in the Essbase web interface, or use Smart View (see Changing the Solve Order of a Selected POV).

The minimum solve order you can set is 0, and the maximum is 127. A higher solve order means the member is calculated later.

To explore use cases for solve order, see the Solve Order templates in the Technical section of the gallery of application workbooks, which you can find in the files catalog in Essbase.

Notes on Solve Order in Non-hybrid Mode

In aggregate storage cubes,

  • Solve order is set to 0 for all dimensions.

  • Aggregation executes in outline order, except:

    • Stored hierarchy members are processed first.
    • Dynamic hierarchy members are processed next.

In non-hybrid block storage cubes, the default solve order is

  • sparse before dense

  • accounts before time

  • attributes last

For full details, see Calculation Order for Dynamic Calculation

Note:

If Accounts members' solve order are set manually to be greater than Time members' solve order, the Accounts will be evaluated after Dynamic Time Series members.