Calculate the Difference for Tables

In your SAP Analytics Cloud table, you can determine the difference between measure values from two time periods.

Prerequisites

A table must be selected. The data source must include a date dimension. However, the table only needs the date dimension when comparing Current Period.

Note
  • SAP HANA models prior to version 122.14 do not support aggregations.

    However, you can use models that have data from an acquired data source.

  • An existing aggregation cannot be used to create another aggregation.

Context

The Difference From aggregation shows the difference in the value of an account between a starting date and a target date that is calculated from a specified number of time periods before or after the starting date. For example, you can compare the sales on February 2015, with the sales 6 months previously.

You can also use the current date as a starting date for your comparison.

Procedure

  1. Select a table.
      1. Under Rows or Columns in the Builder tab, select Add Dimensions and add the Account dimension.

      2. Next to the Account dimension in the Builder tab, select Start of the navigation path Next navigation step Add CalculationEnd of the navigation path.
    Note
    The option to create a new calculation may not appear if calculations are not possible for the model.

    The Calculation Editor appears.

  2. Select Difference From from the list.
  3. Enter a name for the calculation.
  4. In the Measure section, select a measure from the list.
  5. In the Time Dimension section, select the date dimension.
  6. In the Compare (A) section, select Select Time Value, and then choose an option from the list:
    • Current Period
    • Current Date:
      Choose the Granularity level:
      • Year
      • Half Year
      • Quarter
      • Month
      • Week
    • Select by Member:

      Select a value from the list of available members. You can use (Search) to find specific values. When you expand the list beside the search icon, you can choose to view the member Description, ID and Description, or ID, and specify whether to display quarters and halves in the time hierarchy.

    • Create a New Calculation Input Control (This option is available when adding a calculation to a table.):
      1. Enter a name for the input control, and then select Click to Add Values.

      2. Choose how to select values for the input control:
        • Select by Member:

          Select values from the list of available members. If you select Exclude selected members, all members except the ones selected will be included in the input control. You can use (Search) to find specific values. When you expand the list beside the search icon, you can choose to view the member Description, ID and Description, or ID, and specify whether to display quarters and halves in the time hierarchy.

          The members you choose appear in the Selected Members list.

          Expand the Settings for Users section, and then choose whether users can do the following in the input control: Single Selection, Multiple Selection, or Multiple Selection Hierarchy. Select OK.

        • Select by Range:
          Choose a start value and end value for the range. Select Add a New Range to add additional ranges to the input control.
          Note

          The Select by Range option appears only if dimension values are numerical or date based. If the dimension is date based, you can also select quarter, month, or year from the slider that appears. Ranges can be fixed or dynamic; for example, you could choose the fixed range January 2017 to December 2017. If this story is opened in 2018, the story will still show 2017 data. For dynamic date ranges, in addition to the above granularities, these granularities are also available: current year, current quarter, and current month. For more information, see Story and Page Filters.

          Expand the Settings for Users section, and then choose whether users can do the following in the input control: Single Selection, Multiple Selection, or Single Value Slider. Select OK.

      3. Select OK.

    This value is used as the starting date to calculate the difference from.

  7. In the To (B) section, choose PREVIOUS or NEXT.
    • PREVIOUS – calculates the difference between the starting date and a specific previous time period:
      • 'N' Periods
      • Period
      • Year
      • Quarter
      • Month
      • Week
    • Start of the navigation pathNEXT Next navigation step 'N' PeriodsEnd of the navigation path – calculates the difference between the starting date and a future time period.
  8. In the Nth Period section, enter the number of time periods over which to calculate the difference.
    The time period must be a discrete value, or an input control with a static list of discrete values. This is the number of time periods before or after the starting date that you want to compare the value to. The period is the smallest time granularity of the current date, included in your data source. For example, the period may be a year, a quarter, or a month.
    Note
    Month is the smallest time period supported.
  9. Optional:
    • Select Set No Data as Zero: To include a NULL data point in your variance, set it to the value zero.

    • Select Calculate as Percentage.

      Select Absolute Base Value to display the absolute percentage change. Absolute values are useful if you are comparing negative values, but have a positive change (For example, (-20) - (-40) = +20. The percentage change (+20/-40) would be -50% if you did not use absolute values.)

      1. In the Divide By section, choose Compare (A) or To Value (B).

      The Compare (A) is the value of the measure at the starting date. The To Value (B) is the value of the measure at your target date.

  10. Select OK.