#Adding value of current row with previous row

1 messages · Page 1 of 1 (latest)

night swallow
#

We're just starting with building a dashboard on Appsmith where in most cases the use case is simple --> showing the increase of a metric over time (customers, orders, subscriptions, etc.).
I've created a table widget for the new customers added each month. Now I want to add another column where I can show the cumulated customers which is basically just adding the customer value of the current row to the customer value of the previous row. Is this somehow possible?
Thanks a lot and exited to start building here 🙂

coarse swallowBOT
#

Hey! Thanks for reaching out to us :)

#

This is possible with a bit of JS for loops. Get the data into your JS function
and then do this by using a loop over your dataset.

young river
#

Ideally this should be handled at the query level or you'd need to adapt the following code