Tip for showing more than 400 items on a chart axis

Options
ryan_kohn
edited August 2023 in Best Practices

Problem Statement

There is a limit on the number of items that can be displayed on a chart axis in Anaplan. Per the Anapedia page on Chart Settings:

Note: The maximum number of items that can be included in a chart axis is 400 items.

How do I display my chart if my axis has more than 400 items?

Solution (Workaround)

While the actual limit is still in place, it is possible to work around the limit if you are willing to accept a lower fidelity visualization on your chart.

The approach taken in this solution is to "re-scale" your data from a larger scale onto a 400-item scale. The formulas used are based on this helpful answer from Stack Overflow.

What we had originally:

What we want:

Data

In this example, we have a list with 512 items and associated values that we want to plot on a chart.

System

Using system modules, we can set up the basic structure of the re-scaling calculations.

SYS01 includes constants based on the current limits for the axis on UX cards. These values will be used in downstream calculations.

SYS02 is part of our Attributes module. The Sequence line item leverages a simple RANK function to provide an ordered numbered list of the items in our list. We add additional line items to leverage Anaplan aggregations to get the min and max values for the ordered list. We will need these values for downstream calculations.

The above shows the result of the SYS02 calculations.

SYS03 calculates the Scale Conversion Factor, which is used to convert an axis value from the full scale into the compressed scale. Note that this module does not require the My Items dimension.

Finally, in SYS04, we bring back in the My Items dimension to derive the values we need in order to derive our new scale. First, we calculate the new "sequence" value based on the conversation factor. We then round this value to get a whole number, and use an ISFIRSTOCCURRENCE() function to build a filter that will only display the first value in each sequence "bucket".

Output

The last step in our solution is building the chart to leverage the compressed sequence rather than the full sequence. To do this, we just need to apply our filter to the original dataset.

The final result is a chart that shows the larger scale, even though it has only actually charted 400 values! This is also why I mentioned earlier that there is a loss of fidelity — not all of the values are present in the chart. You will need to determine whether or not this workaround is appropriate for your specific dataset.

Comments

  • Note that in Classic, the axis limit is 200 items, per the page for Chart Data Selection:

    Charts display a maximum of the first 200 rows and/or the first 200 columns of a dataset, after filtering has been applied.

    This same approach works for Classic dashboards, with a slight adjustment:

    In this case, we just need to adjust the maximum value in the scale.

    Lastly, you need to apply the filter to your module before selecting the values to plot on the chart you publish on the dashboard.

  • Nicely Done @ryan_kohn This should definitely go to "How to" section so that it gets saved there.