Guidelines for Setting the Calculation Order

How you set the calculation order for a measure affects its computation of data.

On the Aggregation and Disaggregation tab on the Create Measure page, in Aggregation Parameters, you can select Calculate then aggregate or Aggregate then calculate in the Calculation Order field. If you make an incorrect selection in this field, the measure value won't be correct.

Note these guidelines for setting the calculation order of the measure:

  • When the measure's calculation order is Calculate then aggregate, all dependent measures must also use the same order.

    Dependent measures are all the measures (and their dependent measures, in turn) that are used in the main measure's expression.

  • On the Expression tab, your selection of the calculation order along with your use of the Lag and Lead functions can affect the calculation of data.

    The Lag and Lead functions have two parameters. The first parameter contains the measure the function is applied to. The second parameter contains the number of time buckets.

    When you use the Calculate then aggregate order, the second parameter is interpreted as being in days. For example, Lag(Bookings History Average, 10) returns the value of the Bookings History Average measure from 10 days prior to the time period of the table cell.

    When you use the Aggregate then calculate order, the second parameter is interpreted as being in the time level that the measure data is displayed at in the table. For example, in a table that displays monthly time buckets, Lead(Consensus Forecast MAD, 6) returns the value of the Consensus Forecast MAD measure 6 months after the month of the table cell.

    If you've configured the table so that time buckets can be expanded or collapsed, then the time buckets can be interpreted at different levels. For example, if you've configured the table to display both quarterly and monthly time buckets and can expand a quarter to see the underlying months, Lag(Shipments History, 2) returns the value of the Shipments History measure from 2 quarters prior to the cell being reviewed if the quarters are collapsed or 2 months prior to the cell being reviewed if the quarters are expanded.