Re: Could Babel honor spreadsheet formulas?

2020-09-04 Thread Bastien
Hi Uwe,

Uwe Brauer  writes:

> So could babel somehow respect the spreadsheet formula?

Can you restate the request in a way that does not depend on using an
external package like orgtbl-join (however nice it is)?

No promise that anyone will be interested in hacking something, but at
least the attention-base will be larger I guess.

Thanks,

-- 
 Bastien



Could Babel honor spreadsheet formulas?

2020-07-18 Thread Uwe Brauer


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