From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: searching for csv utilities Date: Thu, 04 Jun 2015 23:24:54 +0200 Message-ID: <5570C226.9090300@free.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0cdJ-00017I-Bf for emacs-orgmode@gnu.org; Thu, 04 Jun 2015 17:25:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0cdF-0004Qz-SC for emacs-orgmode@gnu.org; Thu, 04 Jun 2015 17:25:01 -0400 Received: from smtp4-g21.free.fr ([2a01:e0c:1:1599::13]:4589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0cdF-0004QV-Lr for emacs-orgmode@gnu.org; Thu, 04 Jun 2015 17:24:57 -0400 Received: from [IPv6:2a01:e35:2e21:def0:45c3:22a0:2ace:9d05] (unknown [IPv6:2a01:e35:2e21:def0:45c3:22a0:2ace:9d05]) by smtp4-g21.free.fr (Postfix) with ESMTP id E77A54C80C5 for ; Thu, 4 Jun 2015 23:20:47 +0200 (CEST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org You may want to consider a slightly different approach. It may (or maynot) be relevant depending on your context. First, denormalize your table into a "fact table" (which is handy when dealingwith cubes): #+name: data | date | type | q | |------------------+-------+-----| | [2014-04-27 Sun] | Sys | 125 | | [2014-04-28 Mon] | Sys | 102 | | [2014-04-29 Tue] | Sys | 115 | | [2014-04-27 Sun] | Dia | 88 | | [2014-04-28 Mon] | Dia | 88 | | [2014-04-29 Tue] | Dia | 88 | | [2014-04-27 Sun] | Pul | 78 | | [2014-04-28 Mon] | Pul | 86 | | [2014-04-29 Tue] | Pul | 85 | | [2014-04-27 Sun] | Sugar | 92 | | [2014-04-28 Mon] | Sugar | 92 | | [2014-04-29 Tue] | Sugar | 95 | Then using a package named "org-aggregate" (on Melpa) you can derivean aggregated table: #+name: aggr #+BEGIN: aggregate :table data :cols "type vcount() vmean(q) vmax(q) vsdev(q);f3" | type | vcount() | vmean(q) | vmax(q) | vsdev(q);f3 | |-------+----------+----------+---------+-------------| | Sys | 3 | 114 | 125 | 11.533 | | Dia | 3 | 88 | 88 | 0 | | Pul | 3 | 83 | 86 | 4.359 | | Sugar | 3 | 93 | 95 | 1.732 | #+END: If you want to rotate this table, apply a transposition on it(provided by the same package): #+BEGIN: transpose :table "aggr" | type | | Sys | Dia | Pul | Sugar | | vcount() | | 3 | 3 | 3 | 3 | | vmean(q) | | 114 | 88 | 83 | 93 | | vmax(q) | | 125 | 88 | 86 | 95 | | vsdev(q);f3 | | 11.533 | 0 | 4.359 | 1.732 | #+END: You can sort the "data" table on dates without changing theaggregation. Thierry Le 02/06/2015 13:44, Jude DaShiell a =E9crit : > | Date | Sys | Dia | Pul | Sugar | > |------------------+-------------------+-----+-----+-------| > | [2014-04-27 Sun] | 125 | 88 | 78 | 92 | > | [2014-04-28 Mon] | 102 | 88 | 86 | 92 | > | Averages: | =3D$2=3Dvmean(@<..@>) | | | | > #+TBLFM: $2=3D$2=3Dvmean(@<..@>) > > This is a cut down version of my full record set. Sometimes when I > key formulas in I get ?ERROR back for a result after keying in c-c+c-c > once I've completed the formula and hit tab. If I do c-u+c-c+c-c that > sometimes generated ?ERROR. Other times I key in a formula and the > cursor gets locked and I have to hit c-g to exit #+TBLFM: mode; I > don't know what's actually happening when that situation arises since > other than suddenly finding the cursor locked I can neither tell what > state I'm in or if a few more keystrokes are needed or if I've > generated an error situation. > > -- > > >