emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Preparing a cost estimate with Org
@ 2019-01-24 15:59 Lele Gaifax
  2019-01-24 16:41 ` Ken Mankoff
  0 siblings, 1 reply; 4+ messages in thread
From: Lele Gaifax @ 2019-01-24 15:59 UTC (permalink / raw)
  To: emacs-orgmode

Hi all,

I use Org to produce "cost estimate" documents: the goal is to keep in a
single document a detailed log of what I'm asked to work on, the estimated
effort, the estimated cost and the time I actually spend on each item.

I'm already quite satisfied with the overall process and final result: I can
quickly export it as an elegant PDF document and give it to my customer, who
in turn accepts or rejects any single task, decisions that I bring back to the
document as tags (or todo labels) on the headlines.

For my current engagement, for several reasons I do not want to expose the
actual timings to the customer. Given that I could not find a way to omit a
particular column of a table, I opted to have two separated tables, one with
the summary for my own pleasure inside a COMMENT section, and another with
just the costs.

This is a sample of what I came up:

    * COMMENT Efforts summary

      #+NAME: efforts
      #+BEGIN: columnview :id global :indent t :skip-empty-rows t :format "%40ITEM(Item) %13Effort(Effort){:} %CLOCKSUM(Work)"
      | Item       | Effort | Work |
      |------------+--------+------|
      | Tasks      |   3:00 | 0:47 |
      | \_  Task A |   1:00 | 0:19 |
      | \_  Task C |   2:00 | 0:28 |
      #+END:

    #+CONSTANTS: one_minute_cost=0.5

    * Cost estimate

      | Item       | Cost |
      |------------+------|
      | Tasks      |   90 |
      | \_  Task A |   30 |
      | \_  Task C |   60 |
      #+TBLFM: $1='(identity remote(efforts, @@#$1))::$2='(round (* (org-duration-to-minutes (identity remote(efforts, @@#$2))) $one_minute_cost))

    * Tasks

    ** Task A
       :PROPERTIES:
       :Effort:   1:00
       :END:
       :LOGBOOK:
       CLOCK: [2019-01-24 gio 15:51]--[2019-01-24 gio 16:10] =>  0:19
       :END:

    ** Task B                                                               :REJ:
       :PROPERTIES:
       :Rejected-Effort:   2:00
       :END:

    ** Task C
       :PROPERTIES:
       :Effort:   2:00
       :END:
       :LOGBOOK:
       CLOCK: [2019-01-24 gio 15:11]--[2019-01-24 gio 15:39] =>  0:28
       :END:

The only problem with this approach is that it requires a manual intervention
to build the "cost estimate" table: first I recompute the "efforts" one with
C-c C-c, then I copy its body to the other table, delete the third column and
eventually do a C-c C-c on its TBLFM to recompute the costs.

As you can see, "Task B" has been rejected by the customer, so I had to rename
the associated effort property to remove it from the table.

Is there a more efficient/automatic way to achieve a similar result? I mean, is
there a way to

a) keep a single table, but omit a particular column at export time
   or
   have the second table properly populated from the actual tasks tree as it
   happens for the first one

b) filter out entries with a particular tag/property, so that I can keep the
   original estimate
   
?

Thanks in advance for any hints,
ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Preparing a cost estimate with Org
  2019-01-24 15:59 Preparing a cost estimate with Org Lele Gaifax
@ 2019-01-24 16:41 ` Ken Mankoff
  2019-01-24 17:35   ` Lele Gaifax
  0 siblings, 1 reply; 4+ messages in thread
From: Ken Mankoff @ 2019-01-24 16:41 UTC (permalink / raw)
  To: Lele Gaifax; +Cc: emacs-orgmode

Hi Lele,

On 2019-01-24 at 07:59 -0800, Lele Gaifax <lele@metapensiero.it>
wrote...
> The only problem with this approach is that it requires a manual
> intervention to build the "cost estimate" table: first I recompute the
> "efforts" one with C-c C-c, then I copy its body to the other table,
> delete the third column and eventually do a C-c C-c on its TBLFM to
> recompute the costs.

You could perhaps do this with code, so it is only one C-c C-c? Alternatively, is OrgAggregate useful? https://github.com/tbanel/orgaggregate

> Is there a more efficient/automatic way to achieve a similar result? I
> mean, is there a way to
>
> b) filter out entries with a particular tag/property, so that I can
> keep the original estimate

Here is a hack to filter clock entries by tag:

https://lists.gnu.org/archive/html/emacs-orgmode//2009-09/msg00205.html

Finally, the Clock Table documentation https://orgmode.org/manual/The-clock-table.html mentions ‘:match’ with link to https://orgmode.org/manual/Matching-tags-and-properties.html#Matching-tags-and-properties which lets you do negative matches in one of their examples. Can you include only relevant tags, or exclude the tags you want to exclude using that syntax?

  -k.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Preparing a cost estimate with Org
  2019-01-24 16:41 ` Ken Mankoff
@ 2019-01-24 17:35   ` Lele Gaifax
  2019-01-24 18:15     ` Ken Mankoff
  0 siblings, 1 reply; 4+ messages in thread
From: Lele Gaifax @ 2019-01-24 17:35 UTC (permalink / raw)
  To: emacs-orgmode

Ken Mankoff <mankoff@gmail.com> writes:

> Hi Lele,
>
> On 2019-01-24 at 07:59 -0800, Lele Gaifax <lele@metapensiero.it>
> wrote...
>> The only problem with this approach is that it requires a manual
>> intervention to build the "cost estimate" table: first I recompute the
>> "efforts" one with C-c C-c, then I copy its body to the other table,
>> delete the third column and eventually do a C-c C-c on its TBLFM to
>> recompute the costs.
>
> You could perhaps do this with code, so it is only one C-c C-c?
> Alternatively, is OrgAggregate useful?
> https://github.com/tbanel/orgaggregate

Thank you Ken, orgaggregate is really intriguing, I will surely try it out
soon!

I did not understand what you mean with "do this with code" though: some kind
of a macro or what?

>> b) filter out entries with a particular tag/property, so that I can
>> keep the original estimate
>
> Here is a hack to filter clock entries by tag:
>
> https://lists.gnu.org/archive/html/emacs-orgmode//2009-09/msg00205.html
>
> Finally, the Clock Table documentation https://orgmode.org/manual/The-clock-table.html mentions
> ‘:match’ with link to
> https://orgmode.org/manual/Matching-tags-and-properties.html#Matching-tags-and-properties which
> lets you do negative matches in one of their examples. Can you include only relevant tags, or
> exclude the tags you want to exclude using that syntax?

Thanks again, I will read those links!

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele@metapensiero.it  |                 -- Fortunato Depero, 1929.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Preparing a cost estimate with Org
  2019-01-24 17:35   ` Lele Gaifax
@ 2019-01-24 18:15     ` Ken Mankoff
  0 siblings, 0 replies; 4+ messages in thread
From: Ken Mankoff @ 2019-01-24 18:15 UTC (permalink / raw)
  To: Lele Gaifax; +Cc: emacs-orgmode


On 2019-01-24 at 09:35 -0800, Lele Gaifax <lele@metapensiero.it> wrote...
>> You could perhaps do this with code, so it is only one C-c C-c?
>
> I did not understand what you mean with "do this with code" though:
> some kind of a macro or what?

I meant write a Babel Block in your favorite language that takes a table as input (i.e. the table is now a Python or R dataframe) and parses, reformats, and spits out a new table as you want.

You can even set a hook so that babel block executes on export, which means the whole system is automated.

  -k.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-24 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 15:59 Preparing a cost estimate with Org Lele Gaifax
2019-01-24 16:41 ` Ken Mankoff
2019-01-24 17:35   ` Lele Gaifax
2019-01-24 18:15     ` Ken Mankoff

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).