[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: remote calls to tables and (empty entry, NAN)
From: |
Bruno Barbier |
Subject: |
Re: remote calls to tables and (empty entry, NAN) |
Date: |
Fri, 07 Jun 2024 12:48:58 +0200 |
Hi,
Uwe Brauer <oub@mat.ucm.es> writes:
> 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?
This works for me:
#+TBLFM: $2=if(typeof(remote(table2, @@#$7)) == 12, string(""),
remote(table2, @@#$7)); E
(everything is documented here:
https://orgmode.org/manual/Formula-syntax-for-Calc.html#Formula-syntax-for-Calc
)
This works too, although I'm not sure it should:
#+TBLFM: $2=if("remote(table2, @@#$7)" = "nan", string(""), remote(table2,
@@#$7)); E
HTH,
Bruno