[GNC] Formulas in Scheduled Transactions

Fross, Michael michael at fross.org
Tue Nov 16 15:02:31 EST 2021


Hello all,

I have a fixed annuity account which updates with a new total, but does not
show the interest that contributes to that total.  Here is the simple
formula to calculate the interest:

Interest = NewAmount - OldAmount

I thought it would be interesting to have a monthly scheduled
transaction that would request the new value from me (which I get from my
brokerage).  The function would then subtract the current value of the
account (OldAmount) from the value I entered (NewAmount) and then add the
interest as a transaction in the account.

While it's not a big deal to figure it out and just put in the interest, I
thought it would be fun to see if I can get GnuCash to do it, although I
admit I may be asking a bit too much of the scheduled transaction
capability.  Getting the NewAmount is probably as easy as adding a variable
to the scheduled transaction.  Adding the interest as a variable is
probably something that can be done.  I'm not sure how I could get the
current amount in the scheme file to do the subtraction.

Any thoughts on this?   Is it possible?  Pointers on where to begin?  (I'm
been looking through the fin.scm file, but I didn't see much documentation
on this capability)

Thanks in advance!

Michael


More information about the gnucash-user mailing list