[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
remote calls to tables and (empty entry, NAN)
From: |
Uwe Brauer |
Subject: |
remote calls to tables and (empty entry, NAN) |
Date: |
Fri, 07 Jun 2024 09:26:07 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Hi
The following works nicely
#+begin_src
#+NAME: table1
| Name | Ex1 | Ex2 | Ex2 | Ex4 | Ex5 | ResSh1 |
|--------+-----+-----+-----+-----+-----+--------|
| Smith | 2 | 3 | 4 | 6 | 7 | 22 |
| Miller | 2 | 10 | 1 | 1 | 5 | 19 |
| Wick | 1 | 2 | 3 | 10 | 2 | 18 |
#+TBLFM: $7=vsum($2..$6);f2
#+Name: final
| Name | ResSh1 | ResSh2 | Total |
|--------+--------+--------+-------|
| Smith | 22 | | |
| Miller | 19 | | |
| Wick | 18 | | |
#+TBLFM: $2=remote(table1,@@#$7)
#+end_src
However if in table1 there is an empty entry in the relevant column,
remote copies it as 0
#+begin_src
#+NAME: table2
| Name | Ex1 | Ex2 | Ex2 | Ex4 | Ex5 | ResSh1 |
|--------+-----+-----+-----+-----+-----+--------|
| Smith | | 3 | 4 | 6 | 7 | |
| Miller | 2 | 10 | 1 | 1 | 5 | 19 |
| Wick | 1 | 2 | 3 | 10 | 2 | 18 |
#+TBLFM: $7=if("$2" == "nan", string(""),vsum($2..$6)); E f-2
#+Name: total
| Name | ResSh1 | ResSh2 | Total |
|--------+--------+--------+-------|
| Smith | 0 | | |
| Miller | 19 | | |
| Wick | 18 | | |
#+TBLFM: $2=remote(table2,@@#$7)
#+end_src
Any idea how to obtain an empty entry instead of 0?
Thanks and regards
Uwe Brauer
--
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military.
I support the EU and NATO membership of Ukraine.
smime.p7s
Description: S/MIME cryptographic signature
- remote calls to tables and (empty entry, NAN),
Uwe Brauer <=