Learn more about formula issues that might impact your model performance and the actions you can take to fix them.
Are there line items that can be placed in a systems module rather than within a calculation module?
When is this a problem?
Look for functions that result in data that doesn't change (that is, the parent of a line item). Placing these functions in a systems module means that the calculation is run once and can be referenced by multiple line items in multiple modules. Look for: PARENT(PARENT(PARENT(line item))), text field concatenations, and time functions such as START(), CURRENTPERIODSTART(), or CURRENTPERIODEND().
Why is this a problem?
Calculations that are repeated can slow down performance. When these types of functions are included as part of longer formulas, think about how many times they may run if they're included in multiple line items and for multiple list members. It's better for performance for the calculation to run once and be referenced many times.
How to correct
Locate the functions that can be moved to a systems module. Create the systems module, add the function as a line item, and then change the original calculation to reference the line item in the systems module.
Related content
- Planual rules: 2.02-18; 2.02-03; and 2.01-04
- Training: Creating system modules and Build a time system module
- OEG best practice: Reduce calculations for better performance
Are there any formulas that combine text strings?
When is this a problem?
The use of text strings in Anaplan cannot be avoided, so you must ensure that the joins are done in the most efficient way to minimize the impact on performance. Be sure to read the Formula Optimization article. You can find the link in the More Information section below.
Why is this a problem?
Combining text strings takes a lot of memory and can impact performance.
How to correct
Create systems modules that only include the dimension needed. For example, if you want to create a code that consists of an item code and a company code joined together, you would create three systems modules. One that holds the item data, another that holds the company data, and a third that holds the combination of the two.
Related content
- OEG best practice: Formula optimization in Anaplan
- Training: String concatenation
Are there any formulas that are daisy chains?
When is this a problem?
Daisy chain formulas are always a problem. Daisy chains happen when you have a line item in module A that is referenced in module B, which is then referenced in module C, and so on.
This creates a situation where there's a long dependency chain that has to be calculated. Instead, each module should directly reference the data. The line item in module A is referenced directly in module B and is also referenced directly in module C.
Why is this a problem?
Daisy chain formulas require the engine to work harder. Whenever one data point that is used in the calculation changes, the entire sequence must be re-calculated.
How to correct
Break up these formulas. Place parts that need to be referenced multiple times in a systems module, creating a single source of truth.
Related content
- Planual rule: 2.02-19
- OEG best practice: Best practices for module design
Are there long formulas, such as complex IF THEN ELSE statements?
When is this a problem?
If you can't explain the purpose of a formula in one sentence, the formula is too long.
Why is this a problem?
Long formulas, such as complex IF THEN ELSE statements, are difficult to understand, audit, and maintain. Complex formulas use valuable processing time and require the engine to work harder than necessary.
How to correct
Simplify complex IF THEN ELSE statements and put the most common condition first. Break up formulas into multiple line items. If your formula includes more than 10 IF THEN calculations, think about using a LOOKUP. In some situations, you can also consider using a line item subset.
Related content
- Planual rules: 2.02-17 and 2.02-18
- OEG best practices:
Formula structure for performance
Line item subsets demystified
Decreasing the length of your formulas - Training:
Thinking through your formulas
Manipulating data with line item subsets
Is there an excessive use of the FINDITEM function?
When is this a problem?
The FINDITEM function requires a lot from the engine, as it's attempting to find an item in a list and it does this for every cell that is related to that line item. This is especially true when the list includes null values. Excessive use depends on your model and the lists it's being run against.
Why is this a problem?
Using FINDITEM excessively makes the engine work harder than necessary.
How to correct
Check the data for null values before running FINDITEM. So where prod_text is the name of the list, the formula to check for null values is IF ISNOTBLANK(prod_text) THEN FINDITEM(prod_text) ELSE blank. This function is often used when loading data. Think about loading the data into spoke models from the data hub as list formatted line items rather than text.
Related content
- Planual rule: 2.02-02