emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Simple question re: use of conditional in cell formula
@ 2014-02-20 20:05 Subhan Tindall
  2014-02-20 21:02 ` Michael Brand
  0 siblings, 1 reply; 2+ messages in thread
From: Subhan Tindall @ 2014-02-20 20:05 UTC (permalink / raw)
  To: Org-Mode

[-- Attachment #1: Type: text/plain, Size: 5494 bytes --]

Here's my clockreport setup:

'(org-agenda-clockreport-parameter-plist (quote (:link t :maxlevel 3
:formula "$9=$2-$6;t::$8=$2-$5;t::$7=$2-$4;t" :properties (\
"Effort"))))

portion of table output follows (as you can see my effort estimates are
sporadic, and vary in level

What I'd like to do, but can't seem to find the proper syntax for, is use a
conditional assignment so that
when there is no Effort value only a blank, or "***", or similar is in the
destination cell.
SImilarly, when there is no value in one of the time sub-columns the
corresponding cell is left blank

IE
instead of
|              |   0:15 | \_____ DONE <2014-02-12 Wed> email to david...  |
        |       |  0:10 |   0.25 |   0.25 |   0.08 |
I"d like to see:
|              |   0:15 | \_____ DONE <2014-02-12 Wed> email to david...  |
        |       |  0:10 |          |          |   0.08 |
And instead of
|              |        | \__ Todos                                       |
        |  0:45 |       |   0.00 |  -0.75 |   0.00 |
I'd like to see

|              |        | \__ Todos                                       |
        |  0:45 |       |   ****  | *****   |  ****   |

I have searched mightily and can't seem to find any syntax that will work
in my table.
Any ideas or help will be much appreciated!


And, while I'm on the topic, is there anyway way to get a column in the
clocktable to display the sum of all
Effort estimates for it's displayed subtrees?  IE like this:
|              | 0:45 | JWRK PPTDEV-389 VBA macros                      |
30:55 |       |       | -30.92 |   0.00 |   0.00 |  <---- this is sum of
the two efforts below
|              |        | \__ Notes                                       |
        | 30:10 |       |   0.00 | -30.17 |   0.00 |
|              |        | \_____ NOTES Directions to Estimate Redbox...   |
        |       | 30:10 |   0.00 |   0.00 | -30.17 |
|              |        | \__ Todos                                       |
        |  0:45 |       |   0.00 |  -0.75 |   0.00 |
|              |   0:15 | \_____ DONE <2014-02-12 Wed> email to david...  |
        |       |  0:10 |   0.25 |   0.25 |   0.08 |
|              |        | \_____ DONE <2014-02-12 Wed> update...          |
        |       |  0:25 |   0.00 |   0.00 |  -0.42 |
|              |   0:30 | \_____ DONE <2014-02-12 Wed> change...          |
        |       |  0:10 |   0.50 |   0.50 |   0.33 |



| File         | Effort | Headline                                        |
   Time |       |       |        |        |        |
|--------------+--------+-------------------------------------------------+---------+-------+-------+--------+--------+--------|
|              |    ALL | *Total time*                                    |
*38:28* |       |       | -38.47 |   0.00 |   0.00 |
|--------------+--------+-------------------------------------------------+---------+-------+-------+--------+--------+--------|
| Work-log.org |        | *File time*                                     |
*38:28* |       |       | -38.47 |   0.00 |   0.00 |
|              |        | RECURING PPTDEV-514 Miscellaneous               |
   3:12 |       |       |  -3.20 |   0.00 |   0.00 |
|              |        | \__ W07 email, morning                          |
        |  3:12 |       |   0.00 |  -3.20 |   0.00 |
|              |        | RECURING PPTDEV-513 smt 2014 Meetings           |
   2:38 |       |       |  -2.63 |   0.00 |   0.00 |
|              |   0:45 | \__ DONE <2014-02-18 Tue> meeting w/Miriam      |
        |  0:40 |       |   0.75 |   0.08 |   0.75 |
|              |        | \__ Standup                                     |
        |  1:12 |       |   0.00 |  -1.20 |   0.00 |
|              |        | \__ pers. meeting w/steve re:floats, time...    |
        |  0:46 |       |   0.00 |  -0.77 |   0.00 |
|              |        | JWRK PPTDEV-318 HVE Industry - Feed...          |
   1:43 |       |       |  -1.72 |   0.00 |   0.00 |
|              |    0.5 | \__ SPEC redo spec with RDE                     |
        |  0:42 |       |   0.00 |  -0.70 |   0.00 |
|              |   0:30 | \_____ TODO setup coding evironment & review... |
        |       |  0:42 |   0.50 |   0.50 |  -0.20 |
|              |        | \__ TODO Modify...                              |
        |  1:01 |       |   0.00 |  -1.02 |   0.00 |
|              |    4.5 | \_____ NOTES developement notes from Rob        |
        |       |  1:01 |   0.00 |   0.00 |  -1.02 |
|              |        | JWRK PPTDEV-389 VBA macros                      |
  30:55 |       |       | -30.92 |   0.00 |   0.00 |
|              |        | \__ Notes                                       |
        | 30:10 |       |   0.00 | -30.17 |   0.00 |
|              |        | \_____ NOTES Directions to Estimate Redbox...   |
        |       | 30:10 |   0.00 |   0.00 | -30.17 |
|              |        | \__ Todos                                       |
        |  0:45 |       |   0.00 |  -0.75 |   0.00 |
|              |   0:15 | \_____ DONE <2014-02-12 Wed> email to david...  |
        |       |  0:10 |   0.25 |   0.25 |   0.08 |
|              |        | \_____ DONE <2014-02-12 Wed> update...          |
        |       |  0:25 |   0.00 |   0.00 |  -0.42 |
|              |   0:30 | \_____ DONE <2014-02-12 Wed> change...          |
        |       |  0:10 |   0.50 |   0.50 |   0.33




-- 
Subhan Michael Tindall | Software Developer
| smt@rentrakmail.com
RENTRAK | www.rentrak.com | NASDAQ: RENT

[-- Attachment #2: Type: text/html, Size: 6633 bytes --]

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

* Re: Simple question re: use of conditional in cell formula
  2014-02-20 20:05 Simple question re: use of conditional in cell formula Subhan Tindall
@ 2014-02-20 21:02 ` Michael Brand
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Brand @ 2014-02-20 21:02 UTC (permalink / raw)
  To: Subhan Tindall; +Cc: Org-Mode

Hi Subhan

On Thu, Feb 20, 2014 at 9:05 PM, Subhan Tindall
<subhan.tindall@rentrakmail.com> wrote:
> What I'd like to do, but can't seem to find the proper syntax for,
> is use a conditional assignment so that when there is no Effort
> value only a blank, or "***", or similar is in the destination cell.
> SImilarly, when there is no value in one of the time sub-columns the
> corresponding cell is left blank

Are you looking for this?:

In the manual:
http://orgmode.org/manual/Formula-syntax-for-Calc.html

    if("$1" == "nan" || "$2" == "nan", string(""), $1 + $2); E

    Sum of the first two columns. When at least one of the input
    fields is empty the Org table result field is set to empty.

In action: Look at the page with the Worg tutorials and in the
spreadsheet section follow the link to the "Emacs Regression Test
(ERT) for Org tables" with example use cases for TBLFM:
http://orgmode.org/worg/org-tutorials/index.html#Spreadsheet
In the ERT it is test-org-table/empty-field, specifically "Test if
several fields are empty, else do a calculation".

> And, while I'm on the topic, is there anyway way to get a column in
> the clocktable to display the sum of all Effort estimates for it's
> displayed subtrees? IE like this:

I can't follow, maybe because I don't use clocking. Maybe you want to
use the hierarchical sum of a property in column view, here the
property "Effort". See
http://orgmode.org/manual/Column-attributes.html
and
http://orgmode.org/manual/Capturing-column-view.html

Michael

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

end of thread, other threads:[~2014-02-20 21:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20 20:05 Simple question re: use of conditional in cell formula Subhan Tindall
2014-02-20 21:02 ` Michael Brand

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