emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bruno Barbier <brubar.cs@gmail.com>
To: Uwe Brauer <oub@mat.ucm.es>, emacs-orgmode@gnu.org
Subject: Re: remote calls to tables and (empty entry, NAN)
Date: Fri, 07 Jun 2024 12:48:58 +0200	[thread overview]
Message-ID: <6662e59c.050a0220.ebd80.ced5@mx.google.com> (raw)
In-Reply-To: <87ikylfc34.fsf@mat.ucm.es>


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



  reply	other threads:[~2024-06-07 10:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-07  7:26 remote calls to tables and (empty entry, NAN) Uwe Brauer
2024-06-07 10:48 ` Bruno Barbier [this message]
2024-06-07 11:47   ` Uwe Brauer via General discussions about Org-mode.
2024-06-07 20:52   ` Uwe Brauer
2024-06-10 20:13     ` [[SOLVED?]] (was: remote calls to tables and (empty entry, NAN)) Uwe Brauer via General discussions about Org-mode.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6662e59c.050a0220.ebd80.ced5@mx.google.com \
    --to=brubar.cs@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=oub@mat.ucm.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).