Sum values from all Versions

Michael.Mayer
New Contributor

Sum values from all Versions

Hi, 

 

I am trying to sum the total value from one line item for all versions.  The source module contains versions and the module containing the calculation does not have versions.  The formula I used references the source module and line item and returns the value from the current version only.  Is there a formula that can be used to sum all versions.  

 

Note: The purpose of this formula is to identify list items with no value across all versions so that these list items can be deleted from the model. 

1 ACCEPTED SOLUTION

Accepted Solutions
CommunityMember126793
Regular Contributor

Re: Sum values from all Versions

@Michael.Mayer  you can achieve the result as @alexpavel  suggested..... just wanted to showcase through some screen-prints if it will help:

 

1. Yellow highlighted are Versions: 

CommunityMember126793_0-1616673359645.png  CommunityMember126793_1-1616673398269.png

 

2. Use the SELECT function to concatenate (if text) or use (+) to add the values of that particular line item

CommunityMember126793_2-1616673515124.png

Let us know if any more help needed in this context

 

View solution in original post

4 REPLIES 4
rob_marshall
Moderator

Re: Sum values from all Versions

@Michael.Mayer 

 

So, natively, no you can't do a sum across all versions because of the way Anaplan stores the data at the block level.  With that said, you can read half of this article and it will get you where you want.  Basically, you will need to create a line items for the different versions and use the select statement.  If you need multiple line items from the source, then you will need to create a Line Item Subset of the line items (from the source), create a module doing a Collect(), and then from there, pull that information into the "version" line items.

 

https://community.anaplan.com/t5/Best-Practices/Variance-Analysis-With-Native-Versions-Made-Easy/ta-...

 

Rob

alexpavel
Certified Master Anaplanner

Re: Sum values from all Versions

@Michael.Mayer The only solution I see in this case is to use the hard-coded SELECT  statement in the module without Versions, similar to this:

 

line-item[SELECT: Versions.Actual] + line-item[SELECT: Versions.Forecast] + line-item[SELECT: Versions.Budget]

CommunityMember126793
Regular Contributor

Re: Sum values from all Versions

@Michael.Mayer  you can achieve the result as @alexpavel  suggested..... just wanted to showcase through some screen-prints if it will help:

 

1. Yellow highlighted are Versions: 

CommunityMember126793_0-1616673359645.png  CommunityMember126793_1-1616673398269.png

 

2. Use the SELECT function to concatenate (if text) or use (+) to add the values of that particular line item

CommunityMember126793_2-1616673515124.png

Let us know if any more help needed in this context

 

View solution in original post

Michael.Mayer
New Contributor

Re: Sum values from all Versions

Thanks!