* How can you sort an Org clock table?
@ 2014-03-30 21:00 Noah Slater
2014-03-30 21:24 ` Nick Dokos
0 siblings, 1 reply; 13+ messages in thread
From: Noah Slater @ 2014-03-30 21:00 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 399 bytes --]
I posted a question on StackOverflow:
http://stackoverflow.com/questions/22749704/how-can-you-sort-an-org-clock-table
Summary is: how do I sort an clock table by the % column?
Is there anything "out there" I can use to get this working? If not, how
complex a job would it be to write something that did this?
If you point me in the right direction, I'll see what I can come up with.
Thanks!
N
[-- Attachment #2: Type: text/html, Size: 696 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-03-30 21:00 How can you sort an Org clock table? Noah Slater
@ 2014-03-30 21:24 ` Nick Dokos
2014-03-30 22:25 ` Noah Slater
0 siblings, 1 reply; 13+ messages in thread
From: Nick Dokos @ 2014-03-30 21:24 UTC (permalink / raw)
To: emacs-orgmode
Noah Slater <nslater@tumbolia.org> writes:
> I posted a question on StackOverflow:
>
> http://stackoverflow.com/questions/22749704/how-can-you-sort-an-org-clock-table
>
> Summary is: how do I sort an clock table by the % column?
>
> Is there anything "out there" I can use to get this working? If not,
> how complex a job would it be to write something that did this?
>
> If you point me in the right direction, I'll see what I can come up with.
>
Never tried on a clock table, but the following works on a generic
table, so I assume that it will work on a clock table too: put point
in the column by which you want to sort the table (in the body of the
table, not in the header) and say M-x org-sort RET n (I assume you
want numeric sorting, but org-sort provides several kinds). org-sort
is normally bound to C-c ^ too, so
C-c ^ n
should be all that's needed.
--
Nick
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-03-30 21:24 ` Nick Dokos
@ 2014-03-30 22:25 ` Noah Slater
2014-03-31 1:06 ` Nick Dokos
0 siblings, 1 reply; 13+ messages in thread
From: Noah Slater @ 2014-03-30 22:25 UTC (permalink / raw)
To: Nick Dokos; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]
Yeah, tried that. Doesn't work! :(
On 30 March 2014 23:24, Nick Dokos <ndokos@gmail.com> wrote:
> Noah Slater <nslater@tumbolia.org> writes:
>
> > I posted a question on StackOverflow:
> >
> >
> http://stackoverflow.com/questions/22749704/how-can-you-sort-an-org-clock-table
> >
> > Summary is: how do I sort an clock table by the % column?
> >
> > Is there anything "out there" I can use to get this working? If not,
> > how complex a job would it be to write something that did this?
> >
> > If you point me in the right direction, I'll see what I can come up with.
> >
>
> Never tried on a clock table, but the following works on a generic
> table, so I assume that it will work on a clock table too: put point
> in the column by which you want to sort the table (in the body of the
> table, not in the header) and say M-x org-sort RET n (I assume you
> want numeric sorting, but org-sort provides several kinds). org-sort
> is normally bound to C-c ^ too, so
>
> C-c ^ n
>
> should be all that's needed.
> --
> Nick
>
>
>
[-- Attachment #2: Type: text/html, Size: 1735 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-03-30 22:25 ` Noah Slater
@ 2014-03-31 1:06 ` Nick Dokos
2014-03-31 10:18 ` Noah Slater
0 siblings, 1 reply; 13+ messages in thread
From: Nick Dokos @ 2014-03-31 1:06 UTC (permalink / raw)
To: emacs-orgmode
Noah Slater <nslater@tumbolia.org> writes:
> Yeah, tried that. Doesn't work! :(
>
AFAICT, it works fine on your first stackoverflow example.
There is probably no hope of getting this method to work the way you
want on your second example though: org-sort does not know anything
about the substructure of the table. The only way I can think of is to
make the dynblock function that produces the table
(org-dblock-write:clocktable) do the sorting.
> On 30 March 2014 23:24, Nick Dokos <ndokos@gmail.com> wrote:
>
> Noah Slater <nslater@tumbolia.org> writes:
>
> > I posted a question on StackOverflow:
> >
> > http://stackoverflow.com/questions/22749704/how-can-you-sort-an-org-clock-table
> >
> > Summary is: how do I sort an clock table by the % column?
> >
> > Is there anything "out there" I can use to get this working? If not,
> > how complex a job would it be to write something that did this?
> >
> > If you point me in the right direction, I'll see what I can come up with.
> >
>
> Never tried on a clock table, but the following works on a generic
> table, so I assume that it will work on a clock table too: put point
> in the column by which you want to sort the table (in the body of the
> table, not in the header) and say M-x org-sort RET n (I assume you
> want numeric sorting, but org-sort provides several kinds). org-sort
> is normally bound to C-c ^ too, so
>
> C-c ^ n
>
> should be all that's needed.
> --
> Nick
>
--
Nick
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-03-31 1:06 ` Nick Dokos
@ 2014-03-31 10:18 ` Noah Slater
2014-03-31 12:45 ` Nick Dokos
2014-04-16 16:26 ` Bastien
0 siblings, 2 replies; 13+ messages in thread
From: Noah Slater @ 2014-03-31 10:18 UTC (permalink / raw)
To: Nick Dokos; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2202 bytes --]
Ah yes, I see that I have to move the point into the table cell. I was
trying with the table header. Slightly odd that. Means that it only works
on tables that aggregate clock times across multiple files, where the times
are put in the same cell. Can you replicate? If you do a clocktable with
the scope set to that file, then there's no way to order the cells.
How hard would it be to modify org-dblock-write do you think? In hours work
for someone familiar with elisp, but not the org codebase.
On 31 March 2014 03:06, Nick Dokos <ndokos@gmail.com> wrote:
> Noah Slater <nslater@tumbolia.org> writes:
>
> > Yeah, tried that. Doesn't work! :(
> >
>
> AFAICT, it works fine on your first stackoverflow example.
>
> There is probably no hope of getting this method to work the way you
> want on your second example though: org-sort does not know anything
> about the substructure of the table. The only way I can think of is to
> make the dynblock function that produces the table
> (org-dblock-write:clocktable) do the sorting.
>
>
> > On 30 March 2014 23:24, Nick Dokos <ndokos@gmail.com> wrote:
> >
> > Noah Slater <nslater@tumbolia.org> writes:
> >
> > > I posted a question on StackOverflow:
> > >
> > >
> http://stackoverflow.com/questions/22749704/how-can-you-sort-an-org-clock-table
> > >
> > > Summary is: how do I sort an clock table by the % column?
> > >
> > > Is there anything "out there" I can use to get this working? If
> not,
> > > how complex a job would it be to write something that did this?
> > >
> > > If you point me in the right direction, I'll see what I can come
> up with.
> > >
> >
> > Never tried on a clock table, but the following works on a generic
> > table, so I assume that it will work on a clock table too: put point
> > in the column by which you want to sort the table (in the body of the
> > table, not in the header) and say M-x org-sort RET n (I assume you
> > want numeric sorting, but org-sort provides several kinds). org-sort
> > is normally bound to C-c ^ too, so
> >
> > C-c ^ n
> >
> > should be all that's needed.
> > --
> > Nick
> >
>
> --
> Nick
>
>
>
[-- Attachment #2: Type: text/html, Size: 3195 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-03-31 10:18 ` Noah Slater
@ 2014-03-31 12:45 ` Nick Dokos
2014-03-31 13:23 ` Noah Slater
2014-04-16 16:26 ` Bastien
1 sibling, 1 reply; 13+ messages in thread
From: Nick Dokos @ 2014-03-31 12:45 UTC (permalink / raw)
To: emacs-orgmode
Noah Slater <nslater@tumbolia.org> writes:
> Ah yes, I see that I have to move the point into the table cell. I was
> trying with the table header. Slightly odd that. Means that it only
> works on tables that aggregate clock times across multiple files,
> where the times are put in the same cell. Can you replicate? If you do
> a clocktable with the scope set to that file, then there's no way to
> order the cells.
>
> How hard would it be to modify org-dblock-write do you think? In hours
> work for someone familiar with elisp, but not the org codebase.
>
No idea - I have never used clocktables.
> On 31 March 2014 03:06, Nick Dokos <ndokos@gmail.com> wrote:
>
> Noah Slater <nslater@tumbolia.org> writes:
>
> > Yeah, tried that. Doesn't work! :(
> >
>
> AFAICT, it works fine on your first stackoverflow example.
>
> There is probably no hope of getting this method to work the way you
> want on your second example though: org-sort does not know anything
> about the substructure of the table. The only way I can think of is to
> make the dynblock function that produces the table
> (org-dblock-write:clocktable) do the sorting.
>
> > On 30 March 2014 23:24, Nick Dokos <ndokos@gmail.com> wrote:
> >
> > Noah Slater <nslater@tumbolia.org> writes:
> >
> > > I posted a question on StackOverflow:
> > >
> > > http://stackoverflow.com/questions/22749704/how-can-you-sort-an-org-clock-table
> > >
> > > Summary is: how do I sort an clock table by the % column?
> > >
> > > Is there anything "out there" I can use to get this working? If not,
> > > how complex a job would it be to write something that did this?
> > >
> > > If you point me in the right direction, I'll see what I can come up with.
> > >
> >
> > Never tried on a clock table, but the following works on a generic
> > table, so I assume that it will work on a clock table too: put point
> > in the column by which you want to sort the table (in the body of the
> > table, not in the header) and say M-x org-sort RET n (I assume you
> > want numeric sorting, but org-sort provides several kinds). org-sort
> > is normally bound to C-c ^ too, so
> >
> > C-c ^ n
> >
> > should be all that's needed.
> > --
> > Nick
> >
>
> --
> Nick
>
--
Nick
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-03-31 12:45 ` Nick Dokos
@ 2014-03-31 13:23 ` Noah Slater
0 siblings, 0 replies; 13+ messages in thread
From: Noah Slater @ 2014-03-31 13:23 UTC (permalink / raw)
To: Nick Dokos; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2760 bytes --]
Okay thanks. If anyone else does know, I'd really appreciate it. Thanks! :)
On 31 March 2014 14:45, Nick Dokos <ndokos@gmail.com> wrote:
> Noah Slater <nslater@tumbolia.org> writes:
>
> > Ah yes, I see that I have to move the point into the table cell. I was
> > trying with the table header. Slightly odd that. Means that it only
> > works on tables that aggregate clock times across multiple files,
> > where the times are put in the same cell. Can you replicate? If you do
> > a clocktable with the scope set to that file, then there's no way to
> > order the cells.
> >
> > How hard would it be to modify org-dblock-write do you think? In hours
> > work for someone familiar with elisp, but not the org codebase.
> >
>
> No idea - I have never used clocktables.
>
> > On 31 March 2014 03:06, Nick Dokos <ndokos@gmail.com> wrote:
> >
> > Noah Slater <nslater@tumbolia.org> writes:
> >
> > > Yeah, tried that. Doesn't work! :(
> > >
> >
> > AFAICT, it works fine on your first stackoverflow example.
> >
> > There is probably no hope of getting this method to work the way you
> > want on your second example though: org-sort does not know anything
> > about the substructure of the table. The only way I can think of is
> to
> > make the dynblock function that produces the table
> > (org-dblock-write:clocktable) do the sorting.
> >
> > > On 30 March 2014 23:24, Nick Dokos <ndokos@gmail.com> wrote:
> > >
> > > Noah Slater <nslater@tumbolia.org> writes:
> > >
> > > > I posted a question on StackOverflow:
> > > >
> > > >
> http://stackoverflow.com/questions/22749704/how-can-you-sort-an-org-clock-table
> > > >
> > > > Summary is: how do I sort an clock table by the % column?
> > > >
> > > > Is there anything "out there" I can use to get this working?
> If not,
> > > > how complex a job would it be to write something that did
> this?
> > > >
> > > > If you point me in the right direction, I'll see what I can
> come up with.
> > > >
> > >
> > > Never tried on a clock table, but the following works on a
> generic
> > > table, so I assume that it will work on a clock table too: put
> point
> > > in the column by which you want to sort the table (in the body
> of the
> > > table, not in the header) and say M-x org-sort RET n (I assume
> you
> > > want numeric sorting, but org-sort provides several kinds).
> org-sort
> > > is normally bound to C-c ^ too, so
> > >
> > > C-c ^ n
> > >
> > > should be all that's needed.
> > > --
> > > Nick
> > >
> >
> > --
> > Nick
> >
>
> --
> Nick
>
>
>
[-- Attachment #2: Type: text/html, Size: 4041 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-03-31 10:18 ` Noah Slater
2014-03-31 12:45 ` Nick Dokos
@ 2014-04-16 16:26 ` Bastien
2014-04-16 17:01 ` Noah Slater
2014-04-20 9:41 ` Noah Slater
1 sibling, 2 replies; 13+ messages in thread
From: Bastien @ 2014-04-16 16:26 UTC (permalink / raw)
To: Noah Slater; +Cc: Nick Dokos, emacs-orgmode
Hi Noah,
from master, you can now use a :sort parameter in clocktable
to sort a column. For example:
#+BEGIN: clocktable :maxlevel 2 :scope file :sort (2 . ?t)
#+CAPTION: Clock summary at [2014-04-16 mer. 18:12]
| Headline | Time |
|--------------+--------|
| *Total time* | *0:34* |
|--------------+--------|
| STRT abc | 0:15 |
| STRT def | 0:19 |
#+END:
The (2 . ?t) means: "sort the second column by time."
Let me know if it works for you,
--
Bastien
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-04-16 16:26 ` Bastien
@ 2014-04-16 17:01 ` Noah Slater
2014-04-20 9:41 ` Noah Slater
1 sibling, 0 replies; 13+ messages in thread
From: Noah Slater @ 2014-04-16 17:01 UTC (permalink / raw)
To: Bastien; +Cc: Nick Dokos, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 628 bytes --]
Thanks Bastien! I'll look into this and report back.
On 16 April 2014 18:26, Bastien <bzg@gnu.org> wrote:
> Hi Noah,
>
> from master, you can now use a :sort parameter in clocktable
> to sort a column. For example:
>
> #+BEGIN: clocktable :maxlevel 2 :scope file :sort (2 . ?t)
> #+CAPTION: Clock summary at [2014-04-16 mer. 18:12]
> | Headline | Time |
> |--------------+--------|
> | *Total time* | *0:34* |
> |--------------+--------|
> | STRT abc | 0:15 |
> | STRT def | 0:19 |
> #+END:
>
> The (2 . ?t) means: "sort the second column by time."
>
> Let me know if it works for you,
>
> --
> Bastien
>
[-- Attachment #2: Type: text/html, Size: 1056 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-04-16 16:26 ` Bastien
2014-04-16 17:01 ` Noah Slater
@ 2014-04-20 9:41 ` Noah Slater
2014-04-20 10:22 ` Bastien
1 sibling, 1 reply; 13+ messages in thread
From: Noah Slater @ 2014-04-20 9:41 UTC (permalink / raw)
To: Bastien; +Cc: Nick Dokos, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]
Hmm. I'm not sure this is working.
If you add ":link" to the BEGIN blog, the sorting doesn't appear to kick
in. Bug, I expect.
If I remove ":link" I can see that some sorting is taking place. But it's
not what I expect.
With "?t" I am getting this sort order:
- (empty cell)
- "4:02"
- "1d 5:15"
- "1d 9:08"
- "14:19"
With "?T" I am getting this sort order:
- "14:19"
- "1d 9:08"
- "1d 5:15"
- (empty cell)
Note that this isn't the reverse order.
On 16 April 2014 18:26, Bastien <bzg@gnu.org> wrote:
> Hi Noah,
>
> from master, you can now use a :sort parameter in clocktable
> to sort a column. For example:
>
> #+BEGIN: clocktable :maxlevel 2 :scope file :sort (2 . ?t)
> #+CAPTION: Clock summary at [2014-04-16 mer. 18:12]
> | Headline | Time |
> |--------------+--------|
> | *Total time* | *0:34* |
> |--------------+--------|
> | STRT abc | 0:15 |
> | STRT def | 0:19 |
> #+END:
>
> The (2 . ?t) means: "sort the second column by time."
>
> Let me know if it works for you,
>
> --
> Bastien
>
[-- Attachment #2: Type: text/html, Size: 1838 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-04-20 9:41 ` Noah Slater
@ 2014-04-20 10:22 ` Bastien
2014-05-24 18:33 ` Noah Slater
0 siblings, 1 reply; 13+ messages in thread
From: Bastien @ 2014-04-20 10:22 UTC (permalink / raw)
To: Noah Slater; +Cc: Nick Dokos, emacs-orgmode
Noah Slater <nslater@tumbolia.org> writes:
> If you add ":link" to the BEGIN blog, the sorting doesn't appear to
> kick in. Bug, I expect.
Please provide a reproducible example.
--
Bastien
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-04-20 10:22 ` Bastien
@ 2014-05-24 18:33 ` Noah Slater
2014-05-24 22:39 ` Bastien
0 siblings, 1 reply; 13+ messages in thread
From: Noah Slater @ 2014-05-24 18:33 UTC (permalink / raw)
To: Bastien; +Cc: Nick Dokos, emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 762 bytes --]
Here's a broken example:
#+BEGIN: clocktable :maxlevel 2 :link :scope file :sort (2 . ?T)
#+END:
* A
CLOCK: [2014-05-24 Sat 10:00]--[2014-05-24 Sat 11:00] => 1:00
* B
CLOCK: [2014-05-24 Sat 11:00]--[2014-05-24 Sat 12:30] => 1:30
* C
CLOCK: [2014-05-24 Sat 12:30]--[2014-05-24 Sat 15:00] => 2:30
If you run C-c C-c on the clocktable, it will update, but the sorting is
wrong. It should be in reverse order because it's "T" and not "t".
Now: remove ":link" and try again. The sorting works!
On 20 April 2014 12:22, Bastien <bzg@gnu.org> wrote:
> Noah Slater <nslater@tumbolia.org> writes:
>
> > If you add ":link" to the BEGIN blog, the sorting doesn't appear to
> > kick in. Bug, I expect.
>
> Please provide a reproducible example.
>
> --
> Bastien
>
[-- Attachment #2: Type: text/html, Size: 1459 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: How can you sort an Org clock table?
2014-05-24 18:33 ` Noah Slater
@ 2014-05-24 22:39 ` Bastien
0 siblings, 0 replies; 13+ messages in thread
From: Bastien @ 2014-05-24 22:39 UTC (permalink / raw)
To: Noah Slater; +Cc: Nick Dokos, emacs-orgmode
Hi Noah,
Noah Slater <nslater@tumbolia.org> writes:
> Here's a broken example:
>
> #+BEGIN: clocktable :maxlevel 2 :link :scope file :sort (2 . ?T)
> #+END:
You need :link t or :link nil for this block to be correctly formatted.
HTH,
--
Bastien
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2014-05-24 22:39 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-30 21:00 How can you sort an Org clock table? Noah Slater
2014-03-30 21:24 ` Nick Dokos
2014-03-30 22:25 ` Noah Slater
2014-03-31 1:06 ` Nick Dokos
2014-03-31 10:18 ` Noah Slater
2014-03-31 12:45 ` Nick Dokos
2014-03-31 13:23 ` Noah Slater
2014-04-16 16:26 ` Bastien
2014-04-16 17:01 ` Noah Slater
2014-04-20 9:41 ` Noah Slater
2014-04-20 10:22 ` Bastien
2014-05-24 18:33 ` Noah Slater
2014-05-24 22:39 ` Bastien
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).