From mboxrd@z Thu Jan 1 00:00:00 1970 From: Truong Ha Subject: Get the maximum date within a list of dates Date: Sun, 22 Dec 2013 14:29:52 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_82e0635c-492f-4d73-9805-fdf7dd4e2cb7_" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VucY4-0005ZU-R6 for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 01:30:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VucXx-0003l1-HZ for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 01:30:00 -0500 Received: from blu0-omc1-s3.blu0.hotmail.com ([65.55.116.14]:10914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VucXx-0003kx-Da for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 01:29:53 -0500 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" --_82e0635c-492f-4d73-9805-fdf7dd4e2cb7_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi=2C How can I get the maximum date within rows of dates in the table? | Amount | Date |+-----------+------------------+| 158= | <2013-12-01 Sun> || 148 | <2013-12-02 Mon> || 105 | <2013-12= -03 Tue> || 421 | <2013-12-08 Sun> || 40 | <2013-12-10 Tue> ||= 125 | <2013-12-11 Wed> || 50 | <2013-12-12 Thu> || 83 = | <2013-12-13 Fri> || 116 | <2013-12-14 Sat> || 55 | <2013-12-= 15 Sun> || 90 | <2013-12-16 Mon> || 187 | <2013-12-17 Tue> || = 96 | <2013-12-18 Wed> || 86 | <2013-12-19 Thu> || 90 |= <2013-12-20 Fri> || 135 | <2013-12-21 Sat> || 23 | <2013-12-2= 2 Sun> | Thanks=2CHa = --_82e0635c-492f-4d73-9805-fdf7dd4e2cb7_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi=2C

How can= I get the maximum date within rows of dates in the table?

|  =3B  =3BAmount | Date  =3B  =3B  =3B &= nbsp=3B  =3B  =3B |
+-----------+------------------+
|  =3B  =3B  =3B 158 | <=3B2013-12-01 Sun>=3B |
=
|  =3B  =3B  =3B 148 | <=3B2013-12-02 Mon>=3B |
<= div>|  =3B  =3B  =3B 105 | <=3B2013-12-03 Tue>=3B |
|  =3B  =3B  =3B 421 | <=3B2013-12-08 Sun>=3B |
|  =3B  =3B  =3B  =3B40 | <=3B2013-12-10 Tue>=3B |
|  =3B  =3B  =3B 125 | <=3B2013-12-11 Wed>=3B |
|  =3B  =3B  =3B  =3B50 | <=3B2013-12-12 Thu>=3B= |
|  =3B  =3B  =3B  =3B83 | <=3B2013-12-13 Fri= >=3B |
|  =3B  =3B  =3B 116 | <=3B2013-12-14 Sat&= gt=3B |
|  =3B  =3B  =3B  =3B55 | <=3B2013-12-1= 5 Sun>=3B |
|  =3B  =3B  =3B  =3B90 | <=3B201= 3-12-16 Mon>=3B |
|  =3B  =3B  =3B 187 | <=3B2013= -12-17 Tue>=3B |
|  =3B  =3B  =3B  =3B96 | <= =3B2013-12-18 Wed>=3B |
|  =3B  =3B  =3B  =3B86= | <=3B2013-12-19 Thu>=3B |
|  =3B  =3B  =3B &nbs= p=3B90 | <=3B2013-12-20 Fri>=3B |
|  =3B  =3B  = =3B 135 | <=3B2013-12-21 Sat>=3B |
|  =3B  =3B  = =3B  =3B23 | <=3B2013-12-22 Sun>=3B |

Thanks=2C
Ha
= --_82e0635c-492f-4d73-9805-fdf7dd4e2cb7_-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Get the maximum date within a list of dates Date: Sun, 22 Dec 2013 08:00:57 +0100 Message-ID: <8738llbc9i.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vud2D-0001OI-3g for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 02:01:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vud27-000306-Uo for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 02:01:09 -0500 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:63960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vud27-0002zu-OB for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 02:01:03 -0500 Received: by mail-wi0-f174.google.com with SMTP id z2so9930086wiv.1 for ; Sat, 21 Dec 2013 23:01:02 -0800 (PST) In-Reply-To: (Truong Ha's message of "Sun, 22 Dec 2013 14:29:52 +0800") 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: Truong Ha Cc: "emacs-orgmode@gnu.org" Hi Truong, Truong Ha writes: > How can I get the maximum date within rows of dates in the table? > > | Amount | Date | > +-----------+------------------+ > | 158 | <2013-12-01 Sun> | > | 148 | <2013-12-02 Mon> | > | 105 | <2013-12-03 Tue> | > | 421 | <2013-12-08 Sun> | > | 40 | <2013-12-10 Tue> | > | 125 | <2013-12-11 Wed> | > | 50 | <2013-12-12 Thu> | > | 83 | <2013-12-13 Fri> | > | 116 | <2013-12-14 Sat> | > | 55 | <2013-12-15 Sun> | > | 90 | <2013-12-16 Mon> | > | 187 | <2013-12-17 Tue> | > | 96 | <2013-12-18 Wed> | > | 86 | <2013-12-19 Thu> | > | 90 | <2013-12-20 Fri> | > | 135 | <2013-12-21 Sat> | > | 23 | <2013-12-22 Sun> | Put your cursor in @2$2 then C-c ^ T to sort by "reversed" date (oldest last). HTH, -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Get the maximum date within a list of dates Date: Sun, 22 Dec 2013 08:27:08 +0100 Message-ID: <87iouh9whf.fsf@bzg.ath.cx> References: <8738llbc9i.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VudRW-0005yC-N3 for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 02:27:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VudRR-00013E-Ba for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 02:27:18 -0500 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]:48044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VudRR-00012J-4T for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 02:27:13 -0500 Received: by mail-wg0-f45.google.com with SMTP id y10so3879628wgg.0 for ; Sat, 21 Dec 2013 23:27:12 -0800 (PST) In-Reply-To: <8738llbc9i.fsf@bzg.ath.cx> (Bastien's message of "Sun, 22 Dec 2013 08:00:57 +0100") 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: Truong Ha Cc: "emacs-orgmode@gnu.org" Bastien writes: > Put your cursor in @2$2 then C-c ^ T to sort by "reversed" date > (oldest last). Also remember you can use ELisp in formulas: | Date 1 | Date 2 | Duration | |-------------------------+-------------------------+----------| | [2013-12-21 sam. 00:00] | [2013-12-22 dim. 00:00] | 86400.0 | #+TBLFM: $3='(- (org-time-string-to-seconds "$2") (org-time-string-to-seconds "$1"));L PS: note the quotes around "$2" and "$1", they are necessary so that the date is not literally inserted in the formulas when Org is computing it. HTH, -- Bastien From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ha Truong Subject: Re: Get the maximum date within a list of dates Date: Sun, 22 Dec 2013 17:31:05 +0800 Message-ID: References: , <8738llbc9i.fsf@bzg.ath.cx>, <87iouh9whf.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_8ff901cb-75bc-4023-81c7-ce54120f42d5_" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VufNU-0003x5-VL for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 04:31:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VufNP-0006Ia-T4 for emacs-orgmode@gnu.org; Sun, 22 Dec 2013 04:31:16 -0500 In-Reply-To: <87iouh9whf.fsf@bzg.ath.cx> 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: Bastien Cc: "emacs-orgmode@gnu.org" --_8ff901cb-75bc-4023-81c7-ce54120f42d5_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thanks Bastien=2C it's what I am expecting :) > From: bzg@gnu.org > To: truonghatsts@outlook.com > CC: emacs-orgmode@gnu.org > Subject: Re: Get the maximum date within a list of dates > Date: Sun=2C 22 Dec 2013 08:27:08 +0100 >=20 > Bastien writes: >=20 > > Put your cursor in @2$2 then C-c ^ T to sort by "reversed" date > > (oldest last). >=20 > Also remember you can use ELisp in formulas: >=20 > | Date 1 | Date 2 | Duration | > |-------------------------+-------------------------+----------| > | [2013-12-21 sam. 00:00] | [2013-12-22 dim. 00:00] | 86400.0 | > #+TBLFM: $3=3D'(- (org-time-string-to-seconds "$2") (org-time-string-to-s= econds "$1"))=3BL >=20 > PS: note the quotes around "$2" and "$1"=2C they are necessary so > that the date is not literally inserted in the formulas when Org > is computing it. >=20 > HTH=2C >=20 > --=20 > Bastien = --_8ff901cb-75bc-4023-81c7-ce54120f42d5_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Thanks Bastien=2C it's what I am= expecting :)

>=3B From: bzg@gnu.org
>=3B To: truonghats= ts@outlook.com
>=3B CC: emacs-orgmode@gnu.org
>=3B Subject: Re: G= et the maximum date within a list of dates
>=3B Date: Sun=2C 22 Dec 20= 13 08:27:08 +0100
>=3B
>=3B Bastien <=3Bbzg@gnu.org>=3B writ= es:
>=3B
>=3B >=3B Put your cursor in @2$2 then C-c ^ T to sor= t by "reversed" date
>=3B >=3B (oldest last).
>=3B
>=3B A= lso remember you can use ELisp in formulas:
>=3B
>=3B | Date 1 = | Date 2 | Duration |
>=3B |---------= ----------------+-------------------------+----------|
>=3B | [2013-12= -21 sam. 00:00] | [2013-12-22 dim. 00:00] | 86400.0 |
>=3B #+TBLFM: $= 3=3D'(- (org-time-string-to-seconds "$2") (org-time-string-to-seconds "$1")= )=3BL
>=3B
>=3B PS: note the quotes around "$2" and "$1"=2C they= are necessary so
>=3B that the date is not literally inserted in the = formulas when Org
>=3B is computing it.
>=3B
>=3B HTH=2C>=3B
>=3B --
>=3B Bastien
= --_8ff901cb-75bc-4023-81c7-ce54120f42d5_--