Faster method for SUM from multiple sources

Hi Everyone,

Can anyone confirm which of the below is faster?

  1. Final Line Item = Module A. Line Item A [SUM: A, SUM: B, SUM:C] + Module B. Line Item B [SUM: A, SUM: B, SUM:C ]
  2. Line Item 1 = Module A. Line Item A [SUM: A, SUM: B, SUM:C] , Line Item 2 = Module B. Line Item B [SUM: A, SUM: B, SUM:C ] , Final Line Item = Line Item 1 + Line Item 2

Not sure if Anaplan calculates parallelly in the first example.

 Regards,

Aakash Sachdeva

Answers

  • Hi @aakash ,
    2nd method would be faster since Anaplan can calculate both the line items parallelly as opposed to calculating A & then B in that order.

  • @aakash two things to consider here, If your using multiple dimensions in the module then you can go with the First option , Since it will help to reduce the total model size. Second thing if you want calculations faster go with the second option. Hope this helps.

  • @aakash - Second approach would be faster but will take more size as you need to create 3 line items.

    If you don’t have any size constraints, you can go with this approach but if so then go with approach 1 of having calculated in 1 line item but the computation of this approach will not be faster as compared to second approach.

  • Dikshant
    edited February 18

    @aakash In Anaplan, performance optimization depends on how calculations are structured. Between your two approaches:

    1. Single Formula Approach (First Example):Final Line Item = Module A. Line Item A [SUM: A, SUM: B, SUM:C] + Module B. Line Item B [SUM: A, SUM: B, SUM:C ]
      • This combines both SUM operations in one formula.
      • If Anaplan can execute the SUM functions in parallel, this could be slightly more efficient.
      • However, it forces Anaplan to recalculate the SUM for both modules each time the Final Line Item is referenced.
    2. Intermediate Line Item Approach (Second Example):
    Line Item 1 = Module A. Line Item A [SUM: A, SUM: B, SUM:C] , Line Item 2 = Module B. Line Item B [SUM: A, SUM: B, SUM:C ] , Final Line Item = Line Item 1 + Line Item 2
    
    • This approach stores SUM results separately.
    • If multiple calculations rely on the SUMs, Anaplan can reuse the results without recalculating.
    • More readable and potentially avoids redundant calculations.

    Which is faster?

    • If SUM is expensive and used multiple times, the second approach is likely faster because it avoids repeated recalculations.
    • If the SUM functions are only used once, the first approach might be marginally faster but could impact model performance due to recalculations.

    Go with the second approach if your SUM functions are large, used multiple times, or referenced elsewhere.

  • Option 1 → if size is not the issue
    Option 2 → fast solution
    By option 2 you can calculate once and refer multiple times would work.