emacs-orgmode
[Top][All Lists]
Advanced

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

[O] date calculation in org table


From: The Dude
Subject: [O] date calculation in org table
Date: Thu, 23 May 2013 08:43:14 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (darwin)

Hi all,

I'm having hard time to find a solution to my problem.  I've got a
simple table with a dates column where I set an $sdate variable in the
first row.  What I want to achieve is that the dates in the column 4 are
the sum of the date from the row above plus the number of days in column
3 in the same row apart from the field @4$4 which uses the $sdate
variable; thus my naïve column and field formulae:
@4$4=$sdate + $3::address@hidden

--8<---------------cut here---------------start------------->8---
* Test date table

|   | WP | Days | Arrival Date     |
|---+----+------+------------------|
| # |    |      | <2013-06-05 Wed> |
| ^ |    |      | sdate            |
|---+----+------+------------------|
|   |  1 |    4 | <2013-06-09 Sun> |
|   |  - |    2 | <2013-06-11 Tue> |
|   |  2 |    4 | <2013-06-15 Sat> |
|   |  - |    2 | <2013-06-17 Mon> |
|   |  3 |    1 | <2013-06-18 Tue> |
|   |  4 |    2 | <2013-06-20 Thu> |
|   |  5 |    1 | <2013-06-21 Fri> |
|   |  - |    2 | <2013-06-23 Sun> |
|   |  6 |    1 | <2013-06-24 Mon> |
|   |  7 |    2 | <2013-06-26 Wed> |
|   |  - |    1 | <2013-06-27 Thu> |
|   |  8 |    1 | <2013-06-28 Fri> |
|   |  9 |    1 | <2013-06-29 Sat> |
|   |  - |    3 | <2013-07-02 Tue> |
|   | 10 |    3 | <2013-07-05 Fri> |
|   |  - |    1 | <2013-07-06 Sat> |
|   | 11 |    2 | <2013-07-08 Mon> |
|---+----+------+------------------|
|   |    |   33 | <2013-07-08 Mon> |
#+TBLFM: @4$4=$sdate + 
$3::address@hidden::@21$3=vsum(@address@hidden)::@address@hidden::$sdate=<2013-06-05
 Wed>
--8<---------------cut here---------------end--------------->8---

The problem is that when I change the $sdate and recalculate the whole
table with `C-u C-u C-c C-c' only the element @4$4 is set.  It seems
like the column formula doesn't apply to the other fields.

So the question is what am I doing wrongly?  Didn't I get how the column
formula works or is it a problem with the date calculation?

Any help would be very much appreciated,
cheers
-- 
-dude

Too brief? Here's why! http://emailcharter.org




reply via email to

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