Emacs org-mode Summary Table

I have an org file describing a project:

* task1 ** task1-1 :PROPERTIES: :price: 10 :given: <2012-11-08 Thu> :END: ** task1-2 :PROPERTIES: :price: 11 :given: <2012-11-08 Thu> :END: * task2 ** task2-1 :PROPERTIES: :price: 20 :given: <2012-11-08 Thu> :END: ** task2-2 :PROPERTIES: :price: 21 :given: <2012-11-08 Thu> :END: 

I used org-collector to create a summary table:

 #+BEGIN: propview :id global :conds ((not (= price 0))) :cols (ITEM price) | ITEM | price | |-----------+-------| | "task1-1" | 10 | | "task1-2" | 11 | | "task2-1" | 20 | | "task2-2" | 21 | |-----------+-------| | | 62 | #+TBLFM: @6$2=vsum(@ 2$2..@5 $2) #+END: 

But I want to have something like this:

 | ITEM | price | |-----------+-------| | "task1-1" | 10 | | "task1-2" | 11 | | "task2-1" | 20 | | "task2-2" | 21 | |-----------+-------| | Total | 62 | 

How to do it?

+4
source share
2 answers

For the line "Total", you can add the line |Total| | |Total| | , press Cu Cc = in the empty cell (to define a formula for it) and enter the vsum(@ 1$2..@4 $2) formula vsum(@ 1$2..@4 $2) . (If you want recalc, then Cu Cc Cc is for everyone.)

I do not know about org-collector, so I can not help you with this part. Run it on the whole document (works :id global ?) Or move everything one level to the right so that it is inside the same tree. Maybe he will

+5
source

I just figured it out this morning. The answer you are looking for with Org-Collector is simple. Just put the table formulas in two empty lines at the beginning of the property view, and it will be calculated automatically when evaluating the property view (using Cc Cc ).

 #+BEGIN: propview :scope tree :cols (ITEM CLOCKSUM EFFORT) :match "TODO=\"TODO\"" :noquote ALL #+TBLFM: @>$1=Totals::@>$2=vsum(@ I..@II );t::@>$3=vsum(@ I..@II );t #+END: 

If you want to turn this into a generic yasnippet, you need to escape $ and \:

 #+BEGIN: propview :scope tree :cols (ITEM CLOCKSUM EFFORT) :match "TODO=\\"TODO\\"" :noquote ALL #+TBLFM: @>\$1=Totals::@>\$2=vsum(@ I..@II );t::@>\$3=vsum(@ I..@II );t #+END: 

Now you can add a general view of the properties, which calculates the time and effort remaining for each step of the project, as well as the total time as a whole.

0
source

Source: https://habr.com/ru/post/1444939/


All Articles