emacs-orgmode
[Top][All Lists]
Advanced

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

Could Babel honor spreadsheet formulas?


From: Uwe Brauer
Subject: Could Babel honor spreadsheet formulas?
Date: Sat, 18 Jul 2020 21:15:48 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hello 

The orgtbl-join package honors spreadsheet as the following example
shows

#+NAME: TA
| Name  | col1 | col2 |
|-------+------+------|
| User1 |    2 |    2 |

#+NAME: TB
| Name  | col3 |
|-------+------|
| User1 |    4 |

#+NAME: Result
#+BEGIN: join :mas-table "TA" :mas-column "Name" :ref-table "TB" :ref-column 
"Name"
| Name  | col1 | col2 | col3 |   |
|-------+------+------+------+---|
| User1 |    2 |    2 |    4 | 8 |
#+TBLFM: $5=vsum($2..$4);f1
#+END:


So whenever you actualize TA, the table Results will be upgraded.

Unfortunately this package only allow you to add columns not rows. 

In order to add rows the following code can be used 
#+begin_src elisp :var table1=TA  :var table2=TB  :colnames t
(append table1 table2  )
#+end_src

Restulting in 

#+RESULTS:
| User1 | 2 | 2 |
| User1 | 4 |   |
However when I modify this to 

#+Name: New
#+RESULTS:
| User1 | 2 | 2 | 4 |
| User1 | 4 |   | 4 |
#+TBLFM: $4=vsum($2..$3);f1

And upgrade one of the table, execute the babel code, the spreadsheet
formula is gone.

So could babel somehow respect the spreadsheet formula?

Regards

Uwe Brauer 




reply via email to

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