Simple Balance Calculation

135 views
Skip to first unread message

none see

unread,
Jun 13, 2016, 7:53:27 AM6/13/16
to mementodatabase
First of all, beware, I am a newbie so please advice me.
I made expenses and income database. The fields are: Name, Amount In, Amount Out. As simple as that.
I can make the calculation of Sum of field "amount out" and "amount in" , preview them on the bottom of the form (in my mobile)
But how do i make the balance shows in the form (mobile phone)? Balance is normal sum amount of in - sum amount of out

I was thinking to make my database into different models.
Name, Category (amount in; amount out) then numbers.
With that, I can group and sum all "amount in" and "amount out" and show them in the form. But yet, I also dont know how to show the balance in the form.

I thank you for the time to help me. Sorry if this questions sounds too dumb.
Nancy

Bill Crews

unread,
Jun 14, 2016, 10:24:02 AM6/14/16
to mementodatabase
Nancy, do your entries merely contain totals? If so, a Calculation (or JavaScript) field is all you'll need. Create field Balance, type Calculation, result type Real, scale 2, script "#{Amount In} - #{Amount Out}" (or vice versa, depending on what you want).

It sounds like you've already found the Aggregation tab to total any of these fields across all entries or across all entries in a category, which is the more powerful capability.

I once made a library to hold receipts, to break down expenses that come in a set. It uses fields Date or DateTime, Store, Location, Category, Brand, Variety, Item, Quantity, Units, Unit Price, Price, Comment. For this kind of tracking of individual expenditures, the Aggregation totals are the ones of value.

I also once made a General Ledger library, which is more like yours, I guess, where each entry represents an account, with a Debit field and Credit field. Instead of Category, I had a single-choice list field called Section with values like Income, Expense, Asset, Liability, Equity, etc. There was also a Report field, as I recall, so I could show only the Balance Sheet or the Profit & Loss report.

none see

unread,
Jun 21, 2016, 12:29:30 PM6/21/16
to mementodatabase
Thank you so much Bill. I been sorting out your post and found many that valuables. I think for newbie like me, its the best way to learn about memento (by just sort out your posts ;D )

Reply all
Reply to author
Forward
0 new messages