Calculate delta between values of two rows of table

I add every hour a value (total number of written data) to a table in Losant.

Now I want to display the delta between the two entries (last and before last) of the table.

Any help ?

Regards
Holger

Currently dashboards are centered around displaying device data. Data Tables are a brand new additional to our platform and we’re still investigating the best ways to expose the ability to display data from those.

An interesting work-around for now could be to record the delta onto device state. You can setup a timer to trigger once an hour. The workflow could then retrieve the most recent two entries from the data table, calculate the delta, and record it on a device’s state. Once the value is on a device state, you can display it using any number of dashboard blocks.

1 Like

Hello,

thanks for your suggestion.

I finally solved it this way:

I used “Storage GET” and “Storage SET” and calculated the difference in a MATH item.
(Note: The “Storage GET” has to be connected to the data flow, despite it does not use the input)

The result could be sent to a device or table adn then used to trigger some events.

Thanks for the great tool. I really like losant

1 Like