emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Tables for attendance lists - A problem understanding TBLFM?


From: Gunnar Wolf
Subject: Re: [O] Tables for attendance lists - A problem understanding TBLFM?
Date: Tue, 9 Apr 2013 10:31:50 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

(Quoting in full to preserve mail readability without resorting to too
much context)

> > > #+CAPTION: Attendances for April
> > > |---------+-------------------+---+---+---+---+----+-------|
> > > | Account | Name              | 1 | 3 | 5 | 8 | 10 | Total |
> > > |---------+-------------------+---+---+---+---+----+-------|
> > > |    1234 | Cárdenas, Lázaro  | 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$>address@hidden>='(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
> >
> Check the formula again: you seem to have captured the 0 from the last
> column, instead of stopping at the penultimate column. The range should
> be $3..$>> or $<<<..$>>  - also, you should have posted the whole
> substitution history so we could see the range, instead of me guessing. The
> motto should be "More information is better than less", but of course that
> should be tempered by common sense :-)

Trying with:

#+tblfm: @II+1$>address@hidden>='(length(delq "" '($3..$>>)))

The full substitution history is:

Substitution history of formula
Orig:   '(length(delq "" '($3..$7)))
$xyz->  '(length(delq "" '($3..$7)))
@r$c->  '(length(delq "" '("0")))
$1->    '(length(delq "" '("0")))
Result: 1
Format: NONE
Final:  1

Changing the $3 for $<<< yields the exact same result. I cannot see
any "0" - As far as I can understand, the evaluation of an empty
vector for (length ...) gives this "0" ?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]