emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: Re: very long table calc expressions ?
Date: Thu, 21 Jun 2018 15:35:59 +0200	[thread overview]
Message-ID: <877ems1cu8.fsf@mat.ucm.es> (raw)
In-Reply-To: 5B2A9CB4.7090702@free.fr

[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]


   > Le 20/06/2018 11:09, Uwe Brauer a écrit :
   > I included such an example (and added your name to the contributors list).

Thanks! I don't feel that I am a contributor, but thanks very much.


   > Not easily. orgaggregate groups rows using equality, whereas you need to 
   > group rows based on intervals (between 5 and 6.9 for example).

   > But you can prepare the data table with a new, computed column, telling 
   > in which interval each value falls:

   > #+TBLNAME: raw-data
   > | Test | Interval |

   > |------+----------|
   > |    0 | SS       |
   > |    1 | SS       |
   > |    2 | SS       |
   > |    3 | SS       |
   > |    4 | SS       |
   > |    5 | AP       |
   > |    6 | AP       |
   > |    7 | NT       |
   > |    8 | NT       |
   > |    9 | SB       |
   > |      | NP       |
   > |      | NP       |
   > |      | NP       |

   > #+TBLFM: $2= "nan"="$1" ? string("NP") : 0<=$1 && $1<=4.9 ? string("SS") 
   > : 5<=$1 && $1<=6.9 ? string("AP") : 7<=$1 && $1<=8.9 ? string("NT") : 

   > 9<=$1 && $1<=10  ? string("SB") : string("OTHER");E

   > And then orgaggregate can handle it:

   > #+BEGIN: aggregate :table "raw-data" :cols "Interval count()"
   > | Interval | count() |

   > |----------+---------|
   > | SS       |       5 |
   > | AP       |       2 |
   > | NT       |       2 |
   > | SB       |       1 |
   > | NP       |       3 |
   > #+END:


This is great. I have to play a around with it a bit but it looks
*precisely* what I was looking for since quite a while.

I have to admitd that the complicated structure

#+TBLFM: $2= "nan"="$1" ? string("NP") : 0<=$1 && $1<=4.9 ? string("SS")  

I would have never found myself.

Thanks very much. Again I have the feeling that this is a real world
example worth to be mentioned in the documentation (such example make
your package so much more attractive because I presume most users feel
like me, they are overwhelmed by its potential but on able to really use
it). But maybe I am a bit biased :-D

I have not looked into your second part of your answer since the first
seems so useful.

Regards

Uwe 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5025 bytes --]

  reply	other threads:[~2018-06-21 13:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19 17:21 very long table calc expressions ? Uwe Brauer
2018-06-20  6:13 ` Thierry Banel
2018-06-20  9:09   ` Uwe Brauer
2018-06-20 18:28     ` Thierry Banel
2018-06-21 13:35       ` Uwe Brauer [this message]
2018-06-21 19:06 ` Bernt Hansen
2018-06-22 10:28   ` Uwe Brauer
2018-06-22 13:16     ` Bernt Hansen
2018-06-22 14:16       ` Uwe Brauer
2018-06-22 15:03         ` Jonathan Leech-Pepin
2018-06-22 15:25           ` Uwe Brauer
2018-06-22 16:48             ` Nick Dokos
2018-06-22 17:22               ` Thierry Banel
2018-06-22 17:54                 ` Uwe Brauer

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=877ems1cu8.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@gnu.org \
    /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).