Skip to main content
Solved

Calculating forward sum of values

  • February 15, 2024
  • 4 replies
  • 548 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

4 replies

Issam Moalla
Employee
Forum|alt.badge.img+11
  • Employee
  • 69 replies
  • February 15, 2024

Hi @mmusab ,

To achieve this, you could apply the Cumulate function.


Forum|alt.badge.img+5
  • Author
  • Wallflower
  • 14 replies
  • February 15, 2024

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
  • 69 replies
  • Answer
  • February 15, 2024

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
  • 14 replies
  • February 15, 2024

Thanks a lot.