SAP Knowledge Base Article - Public

2984649 - Chart Legends not displaying items in sorted order in SAP Analytics Cloud (SAC)


After applying a sort (Ascending/Descending, Highest to Lowest, Custom Sort) to a chart, the legend of the chart may not display the items in the same sorted order if there are nulls/gaps in the data.


  • SAP Analytics Cloud (Enterprise) 2020.21


The chart visualization itself should honor the sort order chosen, but the chart legend may not because the legend is generated based on processing the order of the groups/members in the chart. Ultimately, the chart isn't aware of the custom sort and can only honor what the query returns.


Some possible workarounds:

  1. Enabling the 'unbooked data' option from the ... menu for the corresponding dimensions in your chart in the designer panel.
  2. Use a calculation to replace any null values with 0 so that a value is included in the resultset returned from the back-end.   One example of a such a calculation (non-BW datasources) is:

    IF (ISNULL (["ProfitAndLoss":Gross Margin]), 0 , ["ProfitAndLoss":Gross Margin] )

Note: In both cases above, the Top N (Auto) may be triggered, so you may need to manually override the Top N to a higher value, or filter the chart further to avoid it.

See Also

Your feedback is important to help us improve our knowledge base.


SAP Cloud for Planning, sc4p, c4p, cforp, cloudforplanning, Cloud for Analytics, Cloud4Analytics, CloudforAnalytics, Cloud 4 Planning, BOC, SAPBusinessObjectsCloud, BusinessObjectsCloud, BOBJcloud, BOCloud., SAC, SAP AC, Cloud-Analytics, CloudAnalytics, SAPCloudAnalytics,Error, Issue, System, Data, User, Unable, Access, Connection, Sac, Connector, Live, Acquisition, Up, Set, setup, Model, BW, Connect, Story, Tenant, Import, Failed, Using, Working, SAML, SSO, sapanalyticscloud, sap analytical cloud, sap analytical cloud, SAC, sap analyst cloud, legend, sort, order , KBA , LOD-ANA-DES , Model, Story Design & Visualizations , Problem


SAP Analytics Cloud 1.0