emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Basic question re. spreadsheet function
@ 2014-01-09 10:13 Steve Dowe
  2014-01-09 14:04 ` Nick Dokos
  2014-01-09 15:36 ` Michael Brand
  0 siblings, 2 replies; 5+ messages in thread
From: Steve Dowe @ 2014-01-09 10:13 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi all,

I'm testing out whether I can use a table in org as a project status
tracker.  In col 6, I have the value of the project (e.g. 162.50) and in
col 9, the status (e.g. quoted, approved, invoiced, closed, etc.)

I would like to see, at a glance, what the value of quoted work is, so I'm
currently doing this in col 12 (pasted from formula editor):

# Column Formulas
$12 = if($9=quoted,$6,0)

( Col 9 in this instance contains "closed" and Col 6 contains 162.50. )

This formula results in the text

 closed = quoted ? 162.5 : 0

being displayed in col 12.  However, in another row where the col 9 does
have the text "quoted", I get pretty much the result I'm looking for, e.g.
"400." will appear in col 12 where I have 400.00 in col 6.

In the instance where the if test proves false, I would like a zero or
nothing appearing.  The intention is to sum this column in a footer row.

I have consulted
http://orgmode.org/manual/Formula-syntax-for-Calc.html#Formula-syntax-for-Calcbut
it contains a dead link (
http://orgmode.org/calc/Logical-Operations.html#Logical-Operations) -
making it harder to RTFM :-)

Thanks,
-- 
  Steve

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

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

* Re: Basic question re. spreadsheet function
  2014-01-09 10:13 Basic question re. spreadsheet function Steve Dowe
@ 2014-01-09 14:04 ` Nick Dokos
  2014-01-09 17:51   ` Steve Dowe
  2014-01-09 15:36 ` Michael Brand
  1 sibling, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2014-01-09 14:04 UTC (permalink / raw)
  To: emacs-orgmode

Steve Dowe <stephen.dowe@gmail.com> writes:



> I have consulted
> http://orgmode.org/manual/Formula-syntax-for-Calc.html#Formula-syntax-for-Calc
> but it contains a dead link
> (http://orgmode.org/calc/Logical-Operations.html# Logical-Operations)
> - making it harder to RTFM :-)
>

Until those are fixed, you can consult the org-mode manual on your own
machine using emacs Info: C-h i should get you to the initial page and
you can drill down. But Info offers search as well and it's integrated
with emacs so e.g. if you evaluate this form in emacs, you'll get to
the appropriate section:

    (info "(org) Formula syntax for Calc")

You can then follow the links to the calc documentation.

-- 
Nick

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

* Re: Basic question re. spreadsheet function
  2014-01-09 10:13 Basic question re. spreadsheet function Steve Dowe
  2014-01-09 14:04 ` Nick Dokos
@ 2014-01-09 15:36 ` Michael Brand
  2014-01-09 17:49   ` Steve Dowe
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Brand @ 2014-01-09 15:36 UTC (permalink / raw)
  To: Steve Dowe; +Cc: Org Mode

Hi Steve

On Thu, Jan 9, 2014 at 11:13 AM, Steve Dowe <stephen.dowe@gmail.com> wrote:
> $12 = if($9=quoted,$6,0)

Follow this path: http://orgmode.org/worg > Tutorials > Tutorials on
specific features > Tables, Spreadsheet, Plotting > The following are
[...] > most of the automated Emacs Regression Tests (ERT) for Org
tables

There you will find test-org-table/compare and there if("$1" == "(z)",
x, y) which hopefully answers your question. The additional
parentheses are Org specific, not Calc specific.

Michael

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

* Re: Basic question re. spreadsheet function
  2014-01-09 15:36 ` Michael Brand
@ 2014-01-09 17:49   ` Steve Dowe
  0 siblings, 0 replies; 5+ messages in thread
From: Steve Dowe @ 2014-01-09 17:49 UTC (permalink / raw)
  To: Org Mode

On Thu, 2014-01-09 at 16:36 +0100, Michael Brand wrote:

> Follow this path: http://orgmode.org/worg > Tutorials > Tutorials on
> specific features > Tables, Spreadsheet, Plotting > The following are
> [...] > most of the automated Emacs Regression Tests (ERT) for Org
> tables

Wow.. it would have taken a long while for me to find this!

> There you will find test-org-table/compare and there if("$1" == "(z)",
> x, y) which hopefully answers your question. The additional
> parentheses are Org specific, not Calc specific.

It perfectly answers the question.  Thank you.

Lots to discover on worg, evidently!

-- 
  Steve

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

* Re: Basic question re. spreadsheet function
  2014-01-09 14:04 ` Nick Dokos
@ 2014-01-09 17:51   ` Steve Dowe
  0 siblings, 0 replies; 5+ messages in thread
From: Steve Dowe @ 2014-01-09 17:51 UTC (permalink / raw)
  To: emacs-orgmode

On Thu, 2014-01-09 at 09:04 -0500, Nick Dokos wrote:
> Until those are fixed, you can consult the org-mode manual on your own
> machine using emacs Info: C-h i should get you to the initial page and
> you can drill down. But Info offers search as well and it's integrated
> with emacs so e.g. if you evaluate this form in emacs, you'll get to
> the appropriate section:
> 
>     (info "(org) Formula syntax for Calc")
> 
> You can then follow the links to the calc documentation.

Thanks for this.  It appears I don't have an org info page installed,
which will be my next challenge :)

I must admit, I need to get more into the habit of consulting Emacs' own
help system.  Thanks for reminding me of it.

-- 
  Steve

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

end of thread, other threads:[~2014-01-09 17:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-09 10:13 Basic question re. spreadsheet function Steve Dowe
2014-01-09 14:04 ` Nick Dokos
2014-01-09 17:51   ` Steve Dowe
2014-01-09 15:36 ` Michael Brand
2014-01-09 17:49   ` Steve Dowe

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