Ubidots Community

All Time Summation of Variables


I have been searching around and have found a few examples of this being used for slightly different cases but nothing exactly like it. Forgive me if this is a simple solution that I am just missing…

But we want to simply add each incoming value for the same variable on top of the previous total. So if I feed the machine 5 lbs the first time and then feed it 7 lbs, I want a total of 12 to be displayed, and so on…Thus creating a widget called “total pounds digested” or similar.


Hi @psalibe,

You can achieve this cumulative summation using synthetic variables, specifically with the cumsum(x) function, which “Calculates the cumulative sum of the variable x”.
This how it look from the editor:

Makes sense?

1 Like

Hello there,
I hope all is fine.Actually,my problem is also same to add all the values of a variable but,as i give zero value the sum variable must reset to zero and then ,start adding further values leaving all previous values.
Good day.

This is actually my requirement :slight_smile: