Dimension Order Affects Calculation Performance

Ensuring consistency in the order of dimensions will help improve the performance of your models. This consistency is relevant for modules and individual line items. Why does the order matter? Anaplan creates and uses indexes to perform calculations. Each cell in a module where dimensions intersect is given an index number.

Here are two simple modules dimensioned by Customer and Product. In the first module, Product comes first and Customer second, and in the second module, Customer is first and Product is second.

DimensionOrder_1.jpg

In this model, there is a third module that calculates revenue as Prices * Volumes.

Anaplan assigns indexes to the intersections in the module. Here are the index values for the two modules. Note that some of the intersections are indexed the same for both modules: Customer 1 and Product 1, Customer 2 and Product 2, and Customer 3 and Product 3, and that the remainder of the cells has a different index number. Customer 1 and Product 2 is indexed with the value of 4 in the top module and the value of 2 in the bottom module.

DimensionOrder_2.jpg

The calculation is Revenue = Price * Volume.

To run the calculation, Anaplan performs the following operations by matching the index values from the two modules.

DimensionOrder_3.jpg

Since the index values are not aligned, the processor scans the index values to find a match before performing the calculation.

When the dimensions in the module are reordered, these are the index values:

DimensionOrder_4.jpg

The index values for each of the modules are now aligned. As the line-items of the same dimensional structure have an identical layout, the data is laid out linearly in memory. The calculation process accesses memory in a completely linear and predictable way. Anaplan’s microprocessors and memory sub-systems are optimized to recognize this pattern of access and to pre-emptively fetch the required data.

DimensionOrder_5.jpg

How does the dimension order become different between modules? When you build a module, Anaplan uses the order that you drag the lists onto the Create Module dialog. The order is also dependent on where the lists are added. The lists that you add to the 'pages' area are first, then the lists that you add to the 'rows' area, and finally the lists added to the 'columns' area.

DimensionOrder_6.jpg

It is simple to re-order the lists and ensure consistency. Follow these steps:

  1. On the Modules pane, (Model Settings>Modules) look for lists that are out of order in the Applies To column. Click the Applies To row that you want to re-order, then click the ellipsis.
    DimensionOrder_7.jpg
  2. In the Select Lists dialog, click OK.
    DimensionOrder_8.jpg
  3. In the Confirm dialog, click OK.
    DimensionOrder_9.jpg
  4. The lists will be in the order that they appear in General Lists.
    DimensionOrder_10.jpg
  5. When you have completed checking the list order in the modules, click the Line Items tab and check the line items. Follow steps 1 through 3 to re-order the lists.

Subsets and Line Item Subsets

One word of caution about Subsets and Line Item subsets. In the example below, we have added a subset and a Line Item Subset to the module:

DimensionOrder_11.jpg

The Applies To is as follows:

DimensionOrder_12.jpg

Clicking on the ellipsis, the dimensions are re-ordered to:

DimensionOrder_13.jpg

The general lists are listed in order first, followed by subsets and then line item subsets.
You still can reorder the dimensions by double-clicking in the Applies to column and manually copying or typing the dimensions in the correct order.

Largest vs. Smallest?

This is the normal follow up question, and unfortunately, the answer is "it depends." Through research we have found that it all depends on the data within the module. Also, it can get very confusing if subsets are used; the Customer list might be bigger than the Products list, but if a subset of Customers is used that is smaller than Products, then what?  

Also, we don't advocate ordering the lists in the General Lists setting in size order; the lists should be ordered in hierarchical order top to bottom, so, by definition, that will be smallest to largest. So our advice is be consistent. Think about how you describe the problem. Does the business talk about Customer by Product, or Products for Customers? Agree to a convention, and stick to it.

Other Dimensions

The calculation performance only relates to the common lists between the source(s) and the target. The order of separate lists in one or other doesn’t have any bearing on the calculation speed.

Comments

Cool post! Great insights for performance tuning!

Got lots more of this sort of thing to come - Keep watching!

thanks for the simple, elegant, powerful explanation.

I have 2 questions here:

1. It is mentioned here that Anaplan remembers the sequence of adding the lists. Is there any specific reason / advantage to save this sequence?

2. Isn't it possible for Anaplan to sort this based on the order provided in General List (instead of asking modeller to manually clicking the ellipsis & then click OK)? In fact, I observed that Anaplan itself sorts the lists based on order of General List when I click ellipsis & select the lists under Blueprint --> Applies to. 

@Sheethal

There is no advantage or disadvantage of the "ordering" as such and have had discussions internally about automatically re-sorting list.  What I would say is the consistency of the ordering is actually more critical than which comes first.  I would always advocate ordering the modules in the way you think about or describe the business and be consistent.  This may be different to how you have ordered the lists in the General lists, It is also worth pointing out that any views of the module (including the default view) are not impacted by the ordering in the Applies setting.  It is worth adding a request to the ideas exchange if this is something of high importance to you

I hope that helps

David

Thank you David!

Thanks David! following up on your example, does it make a difference if one dimension (product) is way bigger than the other? I think I remember to put them in the smaller to larger order (and keep the consistency across module as you indicated), but was not sure if that makes a difference or not.  

Great David.  Follow on question:  please layer in how properties are handled in terms of indexing and ording of lists.

 

Thanks.

@guillaume_arnau Good question and one we have been asked previously.

The evidence is not as conclusive as the consistency as the answers depended on how much dtaa was in the modules.  Sometimes smaller to larger was faster and other times larger to smaller was faster.

You then start to faxctor in subsets and it gets more complicated.  If in doubt, it is worth trying it and seeing if there is a noticable difference

So, the consistency of the ordering is actually more critical than which comes first.  I would always advocate ordering the modules in the way you think about or describe the business and be consistent.  This may be different to how you have ordered the lists in the General lists

@dkolka List properties ARE effectively line items so there is no difference.  However, we don't advocate using them unless essential.  It is best practice to use Modules and line items rather than list properties

Very helpful and actionable - thanks @DavidSmith !

Contributors
Latest Articles
3 weeks ago
3 weeks ago
a month ago
Labels (2)