emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: TRS-80 <lists.trs-80@isnotmyreal.name>
To: emacs-orgmode@gnu.org
Subject: Re: netspend table
Date: Tue, 07 Feb 2023 22:33:56 -0500	[thread overview]
Message-ID: <87zg9ohluj.fsf@isnotmyreal.name> (raw)
In-Reply-To: dab9a951-13e3-23bf-63e2-fc21524af@panix.com

Jude DaShiell <jdashiel@panix.com> writes:

> I think if I ever get good with #TBLFMT lines I'd like to write up
> tables that cover many more useful and simpler calculation tables now
> missing from documented orgmode.

I replied separately about the accounting use-case (and I still think
that's best handled by accounting software).  However I also agree that
tables (spreadsheets especially) are very, very useful for many things.
It's so handy having a little table (and some calculations) right there
in your notes.

It took me quite a while to get the hang of it though, but eventually I
was able to produce some quite impressive (to myself, anyway) results.
I guess what I am trying to say is, stick with it, the payoff is worth
it.

Since you provided this as an example though, we will work with it
anyway.  If you have some other ideas, post them to the list (in new
topics).  I think it would be very helpful for a lot of people to see
some examples of this.  And I'm happy to share what I've learned.

> This is a running balance table and I don't know what kind of a
> #TBLFMT line would be useful for that either.

You probably want to use a formula referencing relative (instead of
absolute) locations, something like:

#+begin_src org
  Original table:
  |--------------+------------------+--------+-------+---------|
  | date         | transaction      | amount |   fee | balance |
  |--------------+------------------+--------+-------+---------|
  | [2023-01-11] | original balance |  +0.00 | +0.00 | +423.17 |
  | [2023-01-12] | dunkin           | -18.68 | -1.00 |  403.49 |
  | [2023-01-13] | WalMart          | -28.68 | -1.00 |  384.88 |
  | [2023-01-16] | Deposit          |      + |       |  634.88 |
  | [2023-01-17] | Capris           |      - |     - |  615.34 |
  | [2023-01-17] | Mcdonalds        |  -4.74 | -1.00 |  609.60 |
  | [2023-01-18] | verizon          |      - |     - |  543.35 |
  | [2023-01-26] | dunkin           |      - |     - |  542.37 |
  | [2023-02-01] | damgoodcafe      | -13.28 | -1.00 |  528.09 |
  |--------------+------------------+--------+-------+---------|

  Empty amounts (signs only) removed:
  |--------------+------------------+--------+-------+---------|
  | date         | transaction      | amount |   fee | balance |
  |--------------+------------------+--------+-------+---------|
  | [2023-01-11] | original balance |  +0.00 | +0.00 | +423.17 |
  | [2023-01-12] | dunkin           | -18.68 | -1.00 |  403.49 |
  | [2023-01-13] | WalMart          | -28.68 | -1.00 |  373.81 |
  | [2023-01-16] | Deposit          |        |       |  373.81 |
  | [2023-01-17] | Capris           |        |       |  373.81 |
  | [2023-01-17] | Mcdonalds        |  -4.74 | -1.00 |  368.07 |
  | [2023-01-18] | verizon          |        |       |  368.07 |
  | [2023-01-26] | dunkin           |        |       |  368.07 |
  | [2023-02-01] | damgoodcafe      | -13.28 | -1.00 |  353.79 |
  |--------------+------------------+--------+-------+---------|
  ,#+TBLFM: @3$5..@>$5 = @-1 + ($-2 + $-1)
#+end_src

I am not sure what those signs (+/-) with empty amounts were about, but
the way I would do it would be to make your entries in the 'amount' and
'fee' columns, and then let the running balance column be calculated.
That's what I did in second table, above.

Let me know if you have any questions.

-- 
Cheers,
TRS-80



  parent reply	other threads:[~2023-02-08  3:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04 19:35 netspend table Jude DaShiell
2023-02-04 23:46 ` Dr. Arne Babenhauserheide
2023-02-05  2:15   ` Jude DaShiell
2023-02-05  8:52     ` Dr. Arne Babenhauserheide
2023-02-08  3:10     ` TRS-80
2023-02-08  3:33 ` TRS-80 [this message]
2023-02-08  4:08   ` Jude DaShiell
2023-02-08  7:58     ` Dr. Arne Babenhauserheide
2023-02-08 17:20       ` Jude DaShiell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zg9ohluj.fsf@isnotmyreal.name \
    --to=lists.trs-80@isnotmyreal.name \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).