2.02-10 Using PREVIOUS() vs CUMULATE()
For long timescales, using PREVIOUS is faster than CUMULATE due to the number of "reads" required for the calculation. So, the expression should be: 'Calc line item' = 'data line item' + PREVIOUS('Calc line item') rather than CUMULATE('data line item')
Exception:
2.02-10a Short Timescales: Where the number of periods is small, Cumulate is faster
Best Practice article:
Performance Issues with Cumulate Over Lists
Comments
-
Rule 2.02-10 Using PREVIOUS vs CUMULATE. For long timescales, using PREVIOUS is faster than CUMULATE due to the number of "reads" required for the calculation. So, the expression should be: 'Calc line item' = 'data line item' + PREVIOUS('Calc line item') rather than CUMULATE('data line item'). It goes against PERFORMANCE elements of PLANS if you wish to go against this rule
Here is how it was done in Pre Planual Era: In order to aggregate the data across the timescale we used to use CUMULATE function to do so. Here the timescale is weekly, multiple years
What is wrong with this method? CUMULATE impacts the performance due to the number of “reads” required.
Exception 2.02-10a Short Timescales: You should use CUMULATE only when the timescale is small. Preferably a Monthly Time Period of 1-2 Years
Here is how it should be done in Planual Way: You can get the same result by using PREVIOUS instead of CUMULATE.
One thing to note is that PREVIOUS works only on Time Periods and doesn’t work on Lists whereas CUMULATE works on both.
When using CUMULATE over a list—this is when using the format CUMULATE (x, y, z)—the performance can be poor with anything that exceeds a few million cells. This is because the function is running on a single CPU thread, which differs from nearly all Anaplan functions. Anaplan gets its efficiency from high levels of concurrent multithreading on the CPU, which is where a calculation is broken down into many smaller tasks that can run in parallel, so it can run much faster.
Here’s a simple example to illustrate.
Fig. A shows a 10-second calculation running on a single thread.Fig. A
Fig. B shows the same calculation split into 10 smaller tasks, so it only takes one second to run. Anaplan servers can use over 100 threads to improve efficiency like this.
Fig. B
Fig C
3 -
Thanks @Misbah for the detailed explaination
0
Title
- Preface
- PLANS
- Planual Conventions
- Zen of Anaplan
- Chapter 1 - Central Library
- Time
- Versions
- Users and Roles
- Contents
- Lists
- Subsets
- Line Item Subsets
- Emojis
- Chapter 2 - Engine
- Modules
- Formulas
- Line Items
- Saved Views
- Chapter 3 - UX Principles
- Hierarchy of Information
- Smart Grouping
- Reduce Visual Load
- Progressive Disclosure
- Use Consistency and Standards
- Provide Help and Guidance
- Use The Correct Data Type
- Give Users Visibility Into Status
- Match With Real World Scenarios
- Check In With End Uses Frequently
- Chapter 4 - UX Build
- Apps
- Dashboards
- Filters
- Chapter 5 - Integration
- Actions
- Processes
- Source Models
- Imports
- Exports
- Import Data Sources
- Data Hub
- Chapter 6 - Application Lifecycle Management
- Revision Tags
- Production Lists
- Architecture
- Deployed Mode
- Managing Changes During Development
- Chapter 7 - Extensions
- Excel
- PowerPoint