From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gunnar Wolf Subject: Re: Tables for attendance lists - A problem understanding TBLFM? Date: Tue, 9 Apr 2013 09:55:09 -0500 Message-ID: <20130409145509.GC115357@gwolf.org> References: <20130408235753.GC109669@gwolf.org> <20130409002519.GA3195@kuru.dyndns-at-home.com> <20130409022123.GD112475@gwolf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPZx4-0005f7-N9 for emacs-orgmode@gnu.org; Tue, 09 Apr 2013 10:55:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPZx1-0001G9-U3 for emacs-orgmode@gnu.org; Tue, 09 Apr 2013 10:55:14 -0400 Received: from lafa.iiec.unam.mx ([132.248.72.141]:60090) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPZx1-0001Fx-Oz for emacs-orgmode@gnu.org; Tue, 09 Apr 2013 10:55:11 -0400 Content-Disposition: inline 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: Nick Dokos Cc: emacs-orgmode@gnu.org Nick Dokos dijo [Mon, Apr 08, 2013 at 11:31:14PM -0400]: > You can turn on formula debugging with C-c { and then you'd > see that in Pancho's case, the list is ("") i.e. a list containing the > empty string - a list of length 1. That might qualify as a bug (or not)= but > =20 > you can easily work around it, using (delq "" list) which deletes empty > strings from the list. Ok - I was not sure on how to use/interpret the debugging facility, but it will surely help me > Try this: >=20 > #+CAPTION: Attendances for April > |---------+-------------------+---+---+---+---+----+-------| > | Account | Name | 1 | 3 | 5 | 8 | 10 | Total | > |---------+-------------------+---+---+---+---+----+-------| > | 1234 | C=C3=A1rdenas, L=C3=A1zaro | X | | X | X | | 3 | > | 5678 | Madero, Francisco | X | X | X | X | | 4 | > | 1544 | Villa, Pancho | | | | | | 0 | > | 0113 | Zapata, Emiliano | | X | X | | | 2 | > |---------+-------------------+---+---+---+---+----+-------| > #+tblfm: @II+1$>..@III-1$>=3D'(length (delq "" '($<<<..$>>))) Interesting, my org-mode version behaves differently, and still gives '1' for the empty row with your version: Substitution history of formula (...) @r$c-> '(length (delq "" '("0"))) $1-> '(length (delq "" '("0"))) Result: 1 I tried substituting the empty quotes in the 'delq' with "0", '(""), '("0")... but always got the same result: 1. > I kept just one formula for clarity. I also tried to avoid absolute > row and column numbers (the $3 seemed better than $<<< though > so I kept it) > : @II is the second separator, $> is the last column > and $>> is the penultimate column. Right, I want to better understand relative addressing, as each month has a different number of columns (and some have different number of rows), and I'd prefer having the same formulas everywhere. How would you suggest me to address "from the third and until the next-to-last column"?