Running balance. 2 ways to do it?


#1

Hello

In this tutorial https://www.ragic.com/intl/en/doc-kb/180/Calculating-a-running-balance-in-Ragic ,
the author uses an action button “Create update record button” to add the [transation id]![amount] to the [acount balance]![current balance] and keep it updated.

In this video tutorial by Berrin https://www.youtube.com/watch?time_continue=3&v=QO0ZIZNgU2Q&feature=emb_title ,
she uses the formula LAST(new balance) in the [account balance]![current balance] field to keep the running balance without the need of action buttons. This way seems more logical to me.

My question is: Will using the first method with action buttons have significant advantage in big databases?

Cheers


#2

Using action has some advantages:

  1. Sometimes not all the entries follow the rules or you don’t want all the entries be be calculated, so using action buttons will be better. You can decide when you want this entry to be calculate.

  2. You can configure that action buttons can only be executed after approval, but the formula will
    be executed when you’re typing entries.

  3. You can add some advanced setting such as create a new subtable record, recalculating the entry…etc. in your action button which makes your button more powerful.


#3

Thanks Phil

There is another way of doing running balances with some conditioning. By using SUMIF formula to sum the quantitties only when the field “status” is “complete”. Like the template PSI lite.

But you are right, there is a whole world to explore with action buttons. With code it should be faster to calculate the balance when the database gets big as it won’t have to recalculate all the transactions in the history. Instead by just taking the current balance and adding the amount of the new transaction it is done.