Skip to main content
Solved

Calculating forward sum of values

  • Feb 15, 2024 3:38 AM UTC
  • 4 replies
  • 917 views

Forum|alt.badge.img+5

Hi

I want to sum the values from my current starting point to the last value available in a metric. As you can see first value is 0.22 and last is -30,993,214 and sum of all those in middle will be 30,669,213 something.

that metric called inp_when to sell asset differs for each sage entity asset. How can i go about doing this calc in simple way? I tried moving sum etc but doesnt work.

 

Best answer by Issam Moalla

Hi @mmusab ,

Yes , consider values your source metric that you are looking to cumulate.
In the screenshot below , I have added Sum forward metric which will add the values forward.

If you are looking to apply cumulate on the reverse order, you would need a Reverse order property in the list you wish to cumulate upon:
 

And apply the formula based on that order using the following formula:

cumulate (Values, Years on Years.'Reverse Order')


Hope this is what you are looking to achieve.
If not could you share an example how the result should be calculated.
Issam

View original

4 replies

Issam Moalla
Employee
Forum|alt.badge.img+11

Hi @mmusab ,

To achieve this, you could apply the Cumulate function.


Forum|alt.badge.img+5
  • Author
  • Wallflower
  • Feb 15, 2024 11:41 AM UTC

Hi @Issam Moalla 

Can you show an example ? I tried but can’t seem to get my head around ? As cumulate only sum previous values.  


Issam Moalla
Employee
Forum|alt.badge.img+11
  • Employee
  • Answer
  • Feb 15, 2024 11:48 AM UTC

Hi @mmusab ,

Yes , consider values your source metric that you are looking to cumulate.
In the screenshot below , I have added Sum forward metric which will add the values forward.

If you are looking to apply cumulate on the reverse order, you would need a Reverse order property in the list you wish to cumulate upon:
 

And apply the formula based on that order using the following formula:

cumulate (Values, Years on Years.'Reverse Order')


Hope this is what you are looking to achieve.
If not could you share an example how the result should be calculated.
Issam


Forum|alt.badge.img+5
  • Author
  • Wallflower
  • Feb 15, 2024 9:36 PM UTC

Thanks a lot.