Sum Transactions Based on Properties Between Two Dates (Days, Weeks, Months)

An often requested output of a trade promotions use case is to understand sales between two specific dates— be it days, weeks, or months. The solution below has one dimension in it but would work equally well with additional dimensions, such as customer or supplier.

Having loaded in the transaction detail following best practice (https://community.anaplan.com/t5/Best-Practices/Data-Hubs-Purpose-and-Peak-Performance/ta-p/48866), a module dimensioned by time and relevant other dimensions will be the outcome

HollyRieke_0-1582821610617.png

Into this module a new line item cumulating the existing metrics is going to be added, this will enable the analysis between two dates to be achieved

HollyRieke_1-1582821610620.png

For both line items, set summaries to none:

HollyRieke_2-1582821610623.png

By doing this, the model size is significantly smaller and calculations aren’t being made unnecessarily. In this model, which is 5 years and 10 products, this module is 15% smaller with summaries to none (36,600 cells) versus with them on (43,300 cells).

For the cumulate formula, use the below:

HollyRieke_3-1582821610624.png

For small datasets, the use of cumulate is faster, but for long time ranges, the below is recommended because of how the Hyperblock works, and if one number changes there’s less impact (see 2.02-10 in Planual):

HollyRieke_4-1582821610624.png

The below is then the outcome.

HollyRieke_5-1582821610627.png

Create a module dimensioned on a new list called trade promotions analysis that contains line items products, plus any other required transaction properties - start date, end date, start date -1 and quantity.

HollyRieke_6-1582821610628.png

The reason for the start date -1 is that to calculate the amount between the two dates the cumulate value at the end, less the cumulate at the start, will not be enough as it will be missing the first date. So, start date -1 is needed.

HollyRieke_7-1582821610629.png

This formula then looks at the time dimensioned module looking up the values inputted in the product, end date line items, and subtracts the value for the same look-ups with the calculated start date -1.

HollyRieke_8-1582821610630.png

The below is then the output and can be published to boards as appropriate

HollyRieke_9-1582821610635.png

The above solution works for all time formats, but if weeks/months are needed, then just turn on summary for time on the cumulate column. This is a good option if analysis is required for any time period and gives the flexibility in the future if required in line with the S of PLANS.

HollyRieke_10-1582821610636.png

All that needs to be done is to format the date fields in the analysis module appropriately and the calculations will continue to work.

HollyRieke_11-1582821610637.png

HollyRieke_12-1582821610638.png

 

HollyRieke_13-1582821610640.png

HollyRieke_14-1582821610643.png

The above will allow you to perform that all important analysis on product performance on a more adhoc basis rather than relying on automated time sums

 

Comments

  • @andrewtye 

    Nicely handled. I'm certain I will be using this. I keep a list of solutions to specific use-cases in One Note,  so I've promptly added this one.

    And, personally, I really appreciate the detail and the extra work you did to show the statistics of using different methods, e.g., turning off summaries, when to use CUMULATE vs PREVIOUS). This stuff really matters because they're inevitable follow-up questions to these types of solutions.

     

    The only other thing I wanted to mention is that I noticed you had a lot of images in this post. If you're like me, you know that writing these best practices takes much longer than it does to actually solve it in Anaplan. It's all those images you have to create and if anything changes, they can cascade and before you know it you're replacing half the images, keeping them in the right order, naming them so you can find them in your subdirectory, etc... I guess what I'm trying to say is thanks. I know it's a lot of work to write these but the value it brings to people like me is priceless. Thank you @andrewtye.