SAP Knowledge Base Article - Public

3241211 - Unable to display negative values in Tree Map chart in SAP Analytics Cloud

Symptom

  • Is it possible to display negative values in Tree Map chart?
  • When adding a Tree Map chart that contains negative values in SAP Analytics Cloud, it display the error:
      
    "A chart cannot be provided because this chart type does not support mixed positive and negative values"

Environment

  • SAP Analytics Cloud 

Reproducing the Issue

  1. In SAP Analytics Cloud, create a Story
  2. Insert a Tree Map chart 
  3. Add a Measure to the chart that contains negative values.
  4. Instead of displaying a Tree Map chart, it displays the error:

    "A chart cannot be provided because this chart type does not support mixed positive and negative values"

Cause

  • By design, Tree Map chart cannot display negative values.

Resolution

  • Create a Calculated Measure to remove the negative values from the chart:
         
    1. In SAP Analytics Cloud, open the Story containing the Tree Map chart.
    2. In the Edit mode, select the Tree Map chart.
    3. On the right side, in the Builder pane, under Measures remove the Measure.
    4. Then under Measures, click "Add Measure", and select "Create Calculation"
    5. In the "Calculator Editor", select the type: "Calculated Measure"
    6. In "Edit Formula" create a condition to return zero (0) for the Measure when there is negative values like:

          IF (  [<Insert Measure Name Here>] < 0, 0, [<Insert Measure Name Here>] )

    7. Click "OK"

      Now, the Tree Map chart will display data.

Keywords

SAC, treemap , KBA , LOD-ANA-DES-CHART , SAP Analytics Cloud core charting , Problem

Product

SAP Analytics Cloud 1.0