Faster method for SUM from multiple sources
Hi Everyone,
Can anyone confirm which of the below is faster?
- 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 ]
- 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.0 -
@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.
0 -
@aakash In Anaplan, performance optimization depends on how calculations are structured. Between your two approaches:
- 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.
- 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.
0 - Single Formula Approach (First Example):
-
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.0