emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: netspend table


From: TRS-80
Subject: Re: netspend table
Date: Tue, 07 Feb 2023 22:33:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]