Work out difference from previous entry in database/RG

Trying to work out how to call a previous thing for calculating the change in value.

e.g. Data type is Marbles with a field containing a value, the number of marbles.

(Marbles) 60
(Marbles) 70
(Marbles) 80
(Marbles) 90

I want to find the change in value from the previous entry. e.g. 90-80. But I can’t figure
out how to call last entry - previous entry.

I was also playing around with figuring out a change in value over a specific time.
e.g. Marbles 90 (modified date:today) - Marbles 60 (modified date:1month ago/start of current year etc)

I want to run just a touch more advanced math on it than simple subtraction. But first I need to find out how to call the data :slight_smile: I’m sure this is all pretty straight forward. I feel like bubble was built
to retrieve and manipulate data.

yes bubble is good at what is called CRUD apps, that acronym is something like copy, retrieve, update and delete, so basically retrieve and manipulate data.

If you have not yet, you should watch all the bubble tutorial videos to get the best understanding of how to use bubble to work with data in the app.

What are you doing to keep track of the previous entries? If nothing, then the previous entry is overwritten by the most current, so difficult to retrieve something that is no longer available. If you are otherwise saving the changes over time, just create a do search for and set constraints to isolate the data you want.

Oh, looks like I missed your reply here. Sorry.

The hidden piece of the puzzle was in how bubble deals with time stamps. Once I figured out
that each thing has a time stamp that can/have to be manipulate down to the second, it all fell into place.

I did stumble on some hacky ways of retrieving “previous thing”, but since each thing has a time stamp that can easily be looked up and moved backward/forward in time, I didn’t find any need for it. First/Last item within a set time range did the trick.

It was also super easy to do a calculation on the fly for something that has not been saved
as a thing, and compare it with a previous entry in the database. Love this bubble stuff so far.