Re: [O] Help on spreadsheet/calc references and improvements

2013-11-13 Thread Bastien
Hi Michael,

Michael Brand  writes:

> On Wed, Nov 13, 2013 at 6:34 PM, Bastien  wrote:
>> Please send me your public key and I'll give you write access.
>
> It works, thank you. I have pushed my patch myself now.

Thanks.

> When and how often is
> http://orgmode.org/manual/References.html
> updated?

It's updated when a new minor or major release is done.

-- 
 Bastien



Re: [O] Help on spreadsheet/calc references and improvements

2013-11-13 Thread Michael Brand
Hi Bastien

On Wed, Nov 13, 2013 at 6:34 PM, Bastien  wrote:
> Please send me your public key and I'll give you write access.

It works, thank you. I have pushed my patch myself now. When and how often is
http://orgmode.org/manual/References.html
updated?

Michael



Re: [O] Help on spreadsheet/calc references and improvements

2013-11-13 Thread Bastien
Hi Michael,

Michael Brand  writes:

> The last paragraph has not been answered yet. Can I ask Jason Dunsmore
> directly to give me write access to Org?

Please send me your public key and I'll give you write access.

Thanks!

-- 
 Bastien



Re: [O] Help on spreadsheet/calc references and improvements

2013-11-13 Thread Michael Brand
Hi Carsten

On Wed, Oct 30, 2013 at 6:59 PM, Michael Brand
 wrote:
> On Fri, Oct 25, 2013 at 3:31 PM, Carsten Dominik
>  wrote:
>> On 24.10.2013, at 22:47, Michael Brand  wrote:
>>> On Thu, Oct 24, 2013 at 8:18 AM, Carsten Dominik
>>>  wrote:
 Michael, would you like to have write access to the git repo?
>>>
>>> Thank you for the trust. As I would like anyway to have a review of my
>>> patches before commit, I think it would not help when I would do the
>>> commit myself. I hope that it is still ok when I prefer a review,
>>> independent of the simplicity of the patch.
>>
>> Yes, reviews are always good!  But with write access you can still
>> install a patch yourself after a review, or make small doc fixes
>> without review etc.
>
> Ok, I see that it would help when I "git push" those of my simple
> changes that maybe don't need a review by a maintainer at any price to
> the master branch myself. I already have write access to Worg, do you
> still need my public key?

The last paragraph has not been answered yet. Can I ask Jason Dunsmore
directly to give me write access to Org?

Michael



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-30 Thread Michael Brand
Hi Carsten

On Fri, Oct 25, 2013 at 3:31 PM, Carsten Dominik
 wrote:
> On 24.10.2013, at 22:47, Michael Brand  wrote:
>> On Thu, Oct 24, 2013 at 8:18 AM, Carsten Dominik
>>  wrote:
>>> Applied, thanks.
>>
>> I can not see the commit, is it pushed?
>>
>>> Michael, would you like to have write access to the git repo?
>>
>> Thank you for the trust. As I would like anyway to have a review of my
>> patches before commit, I think it would not help when I would do the
>> commit myself. I hope that it is still ok when I prefer a review,
>> independent of the simplicity of the patch.
>
> Yes, reviews are always good!  But with write access you can still
> install a patch yourself after a review, or make small doc fixes
> without review etc.

Hi Carsten

Ok, I see that it would help when I "git push" those of my simple
changes that maybe don't need a review by a maintainer at any price to
the master branch myself. I already have write access to Worg, do you
still need my public key?

My question about the whereabouts of my patch
0001-Improve-manual-for-table-formulas.patch.txt that is already
"applied" has been overlooked and if I understand correct it is in
your repo but not yet in the main repo. Since the main repo changed
meanwhile, I assume it will create push conflicts on your side. If
this is correct then please get rid of the patch in your repo and I
will take care of the rest.

Michael



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-25 Thread Nicolas Goaziou
Hello,

Carsten Dominik  writes:

> what exactly do you mean?

I mean that we do not always submit our patches on the ML first, so
others can review them. Sometimes we do, but this is not systematic.

I think this is a cultural thing among communities. When it is the norm,
it can lead to better code and more people knowing more parts of the
code.

I don't know if it is applicable to our community, but it could be worth
trying.


Regards,

-- 
Nicolas Goaziou



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-25 Thread Carsten Dominik

On 25.10.2013, at 12:56, Nicolas Goaziou  wrote:

> Hello,
> 
> Michael Brand  writes:
> 
>> Thank you for the trust. As I would like anyway to have a review of my
>> patches before commit, I think it would not help when I would do the
>> commit myself. I hope that it is still ok when I prefer a review,
>> independent of the simplicity of the patch.
> 
> You can have an access and get your code (sometimes) reviewed if you
> post it on the ML: having write access doesn't mean you're on your own.
> 
> BTW, I think there is some room for improvement in that area among Org
> developers.

Hi Nicolas,

what exactly do you mean?

- Carsten

> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou




Re: [O] Help on spreadsheet/calc references and improvements

2013-10-25 Thread Carsten Dominik

On 24.10.2013, at 22:47, Michael Brand  wrote:

> Hi Carsten
> 
> On Thu, Oct 24, 2013 at 8:18 AM, Carsten Dominik
>  wrote:
>> Applied, thanks.
> 
> I can not see the commit, is it pushed?
> 
>> Michael, would you like to have write access to the git repo?
> 
> Thank you for the trust. As I would like anyway to have a review of my
> patches before commit, I think it would not help when I would do the
> commit myself. I hope that it is still ok when I prefer a review,
> independent of the simplicity of the patch.

Yes, reviews are always good!  But with write access you can still
install a patch yourself after a review, or make small doc fixes
without review etc.

- Carsten

> 
> Michael




Re: [O] Help on spreadsheet/calc references and improvements

2013-10-25 Thread Nicolas Goaziou
Hello,

Michael Brand  writes:

> Thank you for the trust. As I would like anyway to have a review of my
> patches before commit, I think it would not help when I would do the
> commit myself. I hope that it is still ok when I prefer a review,
> independent of the simplicity of the patch.

You can have an access and get your code (sometimes) reviewed if you
post it on the ML: having write access doesn't mean you're on your own.

BTW, I think there is some room for improvement in that area among Org
developers.


Regards,

-- 
Nicolas Goaziou



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-24 Thread Michael Brand
Hi Carsten

On Thu, Oct 24, 2013 at 8:18 AM, Carsten Dominik
 wrote:
> Applied, thanks.

I can not see the commit, is it pushed?

> Michael, would you like to have write access to the git repo?

Thank you for the trust. As I would like anyway to have a review of my
patches before commit, I think it would not help when I would do the
commit myself. I hope that it is still ok when I prefer a review,
independent of the simplicity of the patch.

Michael



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-23 Thread Carsten Dominik
Applied, thanks.

Michael, would you like to have write access to the git repo?

- Carsten

On 23.10.2013, at 17:12, Michael Brand  wrote:

> Hi Carsten, Bastien and Nicolas
> 
> On Fri, Oct 18, 2013 at 9:07 PM, Michael Brand
>  wrote:
>> On Sun, Oct 6, 2013 at 7:03 PM, Michael Brand>  
>> wrote:
>>> @maintainers:
>>> According to the below I tried to improve the Org manual with the
>>> attached patch, please review and apply.
>> 
>> I would like to remind to review and apply the patch attached on
>> [2013-10-06 Sun] to this thread
>> (0001-Improve-manual-for-table-formulas.patch.txt).
> 
> I would like to remind to review and apply the patch attached on
> [2013-10-06 Sun] to this thread
> (0001-Improve-manual-for-table-formulas.patch.txt).
> 
> Michael




Re: [O] Help on spreadsheet/calc references and improvements

2013-10-23 Thread Michael Brand
Hi Carsten, Bastien and Nicolas

On Fri, Oct 18, 2013 at 9:07 PM, Michael Brand
 wrote:
> On Sun, Oct 6, 2013 at 7:03 PM, Michael Brand>  
> wrote:
>> @maintainers:
>> According to the below I tried to improve the Org manual with the
>> attached patch, please review and apply.
>
> I would like to remind to review and apply the patch attached on
> [2013-10-06 Sun] to this thread
> (0001-Improve-manual-for-table-formulas.patch.txt).

I would like to remind to review and apply the patch attached on
[2013-10-06 Sun] to this thread
(0001-Improve-manual-for-table-formulas.patch.txt).

Michael



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-18 Thread Michael Brand
Hi all

On Sun, Oct 6, 2013 at 7:03 PM, Michael Brand
 wrote:
> @maintainers:
> According to the below I tried to improve the Org manual with the
> attached patch, please review and apply.

I would like to remind to review and apply the patch attached on
[2013-10-06 Sun] to this thread
(0001-Improve-manual-for-table-formulas.patch.txt).

Michael



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-06 Thread Michael Brand
Hi Karl

On Sun, Oct 6, 2013 at 10:06 PM, Karl Voit  wrote:
> Please do apply the patch!

Done.

Michael



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-06 Thread Karl Voit
Hi!

* Michael Brand  wrote:
>
> On Sun, Oct 6, 2013 at 8:31 PM, Karl Voit  wrote:
>>
>> I mentioned only the "feature-show" since it is a much wider range
>> than spreadsheet only.
>
> Yes. but someone looking around only in the Worg tutorial section
> "Tables, Spreadsheet, Plotting" will not find it and also from the
> link above the content I would like to point to is not to be expected
> and is still a long way to go: two clicks on the right links and
> browse to the right section. What I had in mind is something like the
> attached patch for Worg as a suggestion. What do you think?

You are absolutely right.

Please do apply the patch!


PS: Good to know that Org-mode headings could be referenced via HTML
anchors on Github :-)

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] Help on spreadsheet/calc references and improvements

2013-10-06 Thread Michael Brand
Hi Karl

On Sun, Oct 6, 2013 at 8:31 PM, Karl Voit  wrote:
> * Michael Brand  wrote:
>> Yes, with all the explanations of how the formulas work your github
>> novoid/org-mode-workshop contains a very nice spreadsheet
>> documentation, for more than just referencing remote tables. Can you
>> please link the section here with mentioning that it contains
>> explanations of how the formulas work?:
>> http://orgmode.org/worg/org-tutorials/index.html
>
> It is already linked with "Org-mode Workshop by Karl Voit, conducted
> at Graz University of Technology in November 2012 (3x4 hours). It
> includes a newer version of the feature-show from the entry above.".
>
> I mentioned only the "feature-show" since it is a much wider range
> than spreadsheet only.

Yes. but someone looking around only in the Worg tutorial section
"Tables, Spreadsheet, Plotting" will not find it and also from the
link above the content I would like to point to is not to be expected
and is still a long way to go: two clicks on the right links and
browse to the right section. What I had in mind is something like the
attached patch for Worg as a suggestion. What do you think?

Michael
From ca580793cb4ac7cc46342b3416527ebbb9ea60d8 Mon Sep 17 00:00:00 2001
From: Michael Brand 
Date: Sun, 6 Oct 2013 21:35:50 +0200
Subject: [PATCH] More links in tutorials for tables

---
 org-hacks.org   |  4 
 org-tutorials/index.org | 15 ++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/org-hacks.org b/org-hacks.org
index cb0c66c..3679757 100644
--- a/org-hacks.org
+++ b/org-hacks.org
@@ -571,6 +571,10 @@ equivalent function after =C-c ^ f=, use this one instead:
 *** Adding Licenses to org files
   You can add pretty standard licenses, such as creative commons or gfdl to 
org articles using [[file:code/elisp/org-license.el][org-license.el]].
 ** Org Table
+   :PROPERTIES:
+   :CUSTOM_ID: Tables
+   :END:
+
 *** Align all tables in a file
 
 Andrew Young provided this function in 
[[http://thread.gmane.org/gmane.emacs.orgmode/58974/focus%3D58976][this 
thread]]:
diff --git a/org-tutorials/index.org b/org-tutorials/index.org
index 6e5195c..edc4f12 100644
--- a/org-tutorials/index.org
+++ b/org-tutorials/index.org
@@ -108,7 +108,7 @@
 - A short 
[[http://lumiere.ens.fr/~guerry/org-playing-with-lists-screencast.html][screencast]]
 presenting a few features of plain lists, by
   Bastien.
 
-** Tables, Spreadseet, Plotting
+** Tables, Spreadsheet, Plotting
 
 - [[file:tables.org][A very short introduction to tables in Org-mode]], by 
Bastien.
 
@@ -117,6 +117,9 @@
 
 - [[file:org-spreadsheet-lisp-formulas.org][Using Emacs lisp for spreadsheet 
formulas]] ([[file:org-tableur-tutoriel.org][french version]]), by Bastien.
 
+- 
[[https://github.com/novoid/org-mode-workshop/blob/master/featureshow/org-mode-teaser.org#1131-referencing-example-with-detailed-explanation][Various
 spreadsheet formulas with explanations how they work]]
+  by Karl Voit.
+
 - [[file:org-plot.org][Plotting tables in Org-Mode using org-plot]] by Eric 
Schulte
 
 - [[file:org-dot-diagrams.org][Plotting process diagrams or work flows in 
Org-Mode using dot]] by Karl Voit
@@ -131,6 +134,16 @@
 
 - [[file:org-lookups.org][Table lookup functions]] by Jarmo Hurri
 
+- The following are not tutorials but listed here somehow for
+  "completeness" of the information sources to be checked too:
+  - [[http://orgmode.org/manual/The-spreadsheet.html][Org manual, section 
about spreadsheet]]
+
+  - [[http://orgmode.org/worg/org-faq.html#Tables][Worg FAQ, section about 
tables]]
+
+  - [[http://orgmode.org/worg/org-hacks.html#Tables][Worg hacks, section about 
tables]]
+
+  - 
[[http://orgmode.org/w/org-mode.git?p=org-mode.git;a=blob;f=testing/lisp/test-org-table.el;hb=HEAD][most
 of the automated Emacs Regression Tests (ERT) for Org tables]]
+
 ** Dates and Times
 
 - [[http://members.optusnet.com.au/~charles57/GTD/org_dates/][Using Dates and 
Times in Emacs Org-mode]] by 
[[http://members.optusnet.com.au/~charles57/GTD/][Charles Cave]].
-- 
1.7.12.4 (Apple Git-37)



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-06 Thread Karl Voit
* Michael Brand  wrote:
>
> Hi Karl, hi all

Hi Michael!

> Yes, with all the explanations of how the formulas work your github
> novoid/org-mode-workshop contains a very nice spreadsheet
> documentation, for more than just referencing remote tables. Can you
> please link the section here with mentioning that it contains
> explanations of how the formulas work?:
> http://orgmode.org/worg/org-tutorials/index.html

It is already linked with "Org-mode Workshop by Karl Voit, conducted
at Graz University of Technology in November 2012 (3x4 hours). It
includes a newer version of the feature-show from the entry above.".

I mentioned only the "feature-show" since it is a much wider range
than spreadsheet only.

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] Help on spreadsheet/calc references and improvements

2013-10-06 Thread Michael Brand
Hi Karl, hi all

@maintainers:
According to the below I tried to improve the Org manual with the
attached patch, please review and apply.

On Sun, Oct 6, 2013 at 1:30 PM, Karl Voit  wrote:
> The things I learned about referencing other tables I documented in [1].
>
> Maybe you'll find it handy as a reference to referencing tables :-)
>
>   1. 
> https://raw.github.com/novoid/org-mode-workshop/master/featureshow/org-mode-teaser.org
>  search for "referencing example with detailed explanation"

Yes, with all the explanations of how the formulas work your github
novoid/org-mode-workshop contains a very nice spreadsheet
documentation, for more than just referencing remote tables. Can you
please link the section here with mentioning that it contains
explanations of how the formulas work?:
http://orgmode.org/worg/org-tutorials/index.html

Your new example in github novoid/org-mode-workshop with
@2=remote(Income2012h, @3$$#)
- motivated by my example in the current Org manual
- that interprets text as a Calc algebraic expression, which is
  subject to reformatting
reminded me of that just copying fields is better done with a Lisp
formula "'(identity [...])", see attached patch for the Org manual.

Michael
From a3efc3edd94ccc21544792ddde4a6c54284100ce Mon Sep 17 00:00:00 2001
From: Michael Brand 
Date: Sun, 6 Oct 2013 19:01:15 +0200
Subject: [PATCH] Improve manual for table formulas

* doc/org.texi (Field coordinates in formulas): Rephrase and add an
example with a Lisp formula to copy from remote table.
---
 doc/org.texi | 33 -
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index 0271d70..0a90d33 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -2551,21 +2551,28 @@ for Calc}.
 @cindex row, of field coordinates
 @cindex column, of field coordinates
 
-For Calc formulas and Lisp formulas @code{@@#} and @code{$#} can be used to
-get the row or column number of the field where the formula result goes.
-The traditional Lisp formula equivalents are @code{org-table-current-dline}
-and @code{org-table-current-column}.  Examples:
+One of the very first actions during evaluation of Calc formulas and Lisp
+formulas is to substitute @code{@@#} and @code{$#} in the formula with the
+row or column number of the field where the current result will go to.  The
+traditional Lisp formula equivalents are @code{org-table-current-dline} and
+@code{org-table-current-column}.  Examples:
 
-@example
-if(@@# % 2, $#, string(""))   @r{column number on odd lines only}
-$3 = remote(FOO, #$2)  @r{copy column 2 from table FOO into}
- @r{column 3 of the current table}
-@end example
+@table @code
+@item if(@@# % 2, $#, string(""))
+Insert column number on odd rows, set field to empty on even rows.
+@item $2 = '(identity remote(FOO, #$1))
+Copy text or values of each row of column 1 of the table named @code{FOO}
+into column 2 of the current table.
+@item @@3 = 2 * remote(FOO, @@1$$#)
+Insert the doubled value of each column of row 1 of the table named
+@code{FOO} into row 3 of the current table.
+@end table
 
-@noindent For the second example, table FOO must have at least as many rows
-as the current table.  Note that this is inefficient@footnote{The computation 
time scales as
-O(N^2) because table FOO is parsed for each field to be copied.} for large
-number of rows.
+@noindent For the second/third example, the table named @code{FOO} must have
+at least as many rows/columns as the current table.  Note that this is
+inefficient@footnote{The computation time scales as O(N^2) because the table
+named @code{FOO} is parsed for each field to be read.} for large number of
+rows/columns.
 
 @subsubheading Named references
 @cindex named references
-- 
1.7.12.4 (Apple Git-37)



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-06 Thread Karl Voit
* Karl Voit  wrote:
>
> I am no expert with calc. I enjoy using it for rather
> simple things. However, I would like to use referencing more often
> and I face an issue here.
>
> I did a very basic example in two ways: vertical layout and
> horizontal layout. The reason for this is, that I got the feeling
> that referencing a set of values (not a single cell) differs in
> capabilities from rows to columns.

I could solve all of my issues with the kind help of Michael.

The things I learned about referencing other tables I documented in [1].

Maybe you'll find it handy as a reference to referencing tables :-)

  1. 
https://raw.github.com/novoid/org-mode-workshop/master/featureshow/org-mode-teaser.org
 search for "referencing example with detailed explanation"
-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] Help on spreadsheet/calc references and improvements

2013-10-05 Thread Michael Brand
Hi Karl

On Sat, Oct 5, 2013 at 6:08 PM, Karl Voit  wrote:
> | Descr | Current Data2+ | diff | abs.diff |
> |---++--+--|
> | foo   |  9 |   -1 |1 |
> | bar   | 20 |   -4 |4 |
> | baz   | 23 |   +6 |6 |
> |---++--+--|
> | sum   | 52 |  |   11 |
>
> $2 are manually entered values to compare Data2 from above. I still
> have no idea how to adopt your reference example for $3 and $4.
> Would you please help me one more time?

Here you are:

#+NAME: Data23vert
| Descr+ | Data1+ | Data2+ |
|++|
| foo| 12 | 10 |
| bar| 22 | 24 |
| baz| 16 | 17 |
|++|
| sum| 50 | 51 |

| Descr | Current Data2+ | diff | abs.diff |
|---++--+--|
| foo   |  9 |   -1 |1 |
| bar   | 20 |   -4 |4 |
| baz   | 23 |6 |6 |
|---++--+--|
| sum   | 52 |  |   11 |
#+TBLFM: $3 = $2 - remote(Data23vert, @@#$3) :: $4 = abs($3) :: @5$3 =
string("") :: @5$4 = vsum(@I..@II)

Or use
$4 = abs($2 - remote(Data23vert, @@#$3))
if you prefer.

Michael



Re: [O] Help on spreadsheet/calc references and improvements

2013-10-05 Thread Karl Voit
* Michael Brand  wrote:
> Hi Karl

Hi!

> You may want to look at the example "$3 = remote(FOO, @@#$2)" in the
> Org manual, then it becomes quite simple.

:-)

I have to admit that I found @@#$2 in the manual. However, I was not
able to understand its meaning at all :-(

With your example below, I begin to understand it a bit. Thanks!

>> #+NAME: Data23vert
>> | Descr+ | Data1+ | Data2+ |
>> |++|
>> | foo| 12 | 10 |
>> | bar| 22 | 24 |
>> | baz| 16 | 17 |
>> |++|
>> | sum| 50 | 51 |
>
>| Descr | Data2 | Double |
>|---+---+|
>| foo   |10 | 20 |
>| bar   |24 | 48 |
>| baz   |17 | 34 |
>|---+---+|
>| sum   |51 |102 |
> #+TBLFM: $2 = remote(Data23vert, @@#$3) :: $3 = 2 * remote(Data23vert, @@#$3)

May I add another example I cannot cope with?

| Descr | Current Data2+ | diff | abs.diff |
|---++--+--|
| foo   |  9 |   -1 |1 |
| bar   | 20 |   -4 |4 |
| baz   | 23 |   +6 |6 |
|---++--+--|
| sum   | 52 |  |   11 |

$2 are manually entered values to compare Data2 from above. I still
have no idea how to adopt your reference example for $3 and $4.
Would you please help me one more time?

>> #+NAME: Data23horiz
>> | Descr+ | foo | bar | baz | sum |
>> |+-+-+-+-|
>> | Data1+ |  12 |  22 |  16 |  50 |
>> | Data2+ |  10 |  24 |  17 |  51 |
>
>| Descr  | foo | bar | baz | sum |
>|+-+-+-+-|
>| Data2  |  10 |  24 |  17 |  51 |
>| Double |  20 |  48 |  34 | 102 |
> #+TBLFM: @2$2..@2$5 = remote(Data23horiz, @3$$#) :: @3$2..@3$5 = 2 *
> remote(Data23horiz, @3$$#)

Helped me a lot, thanks! ("$$#" is not mentioned in the Org-manual at all.)

-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github




Re: [O] Help on spreadsheet/calc references and improvements

2013-10-05 Thread Michael Brand
Hi Karl

On Sat, Oct 5, 2013 at 4:49 PM, Karl Voit  wrote:
> Feel free to make suggestions how to overcome my lack of knowledge

You may want to look at the example "$3 = remote(FOO, @@#$2)" in the
Org manual, then it becomes quite simple.

> #+NAME: Data23vert
> | Descr+ | Data1+ | Data2+ |
> |++|
> | foo| 12 | 10 |
> | bar| 22 | 24 |
> | baz| 16 | 17 |
> |++|
> | sum| 50 | 51 |
>
> #+NAME: Calc23vert-WISH
> | Descr | Data2 | Double  |
> |---+---+-|
> | foo   |10 |  20 |
> | bar   |24 |  48 |
> | baz   |17 |  34 |
> |---+---+-|
> | sum   |51 | 102 |
> #+TBLFM: FIXXME

#+NAME: Data23vert
| Descr+ | Data1+ | Data2+ |
|++|
| foo| 12 | 10 |
| bar| 22 | 24 |
| baz| 16 | 17 |
|++|
| sum| 50 | 51 |

| Descr | Data2 | Double |
|---+---+|
| foo   |10 | 20 |
| bar   |24 | 48 |
| baz   |17 | 34 |
|---+---+|
| sum   |51 |102 |
#+TBLFM: $2 = remote(Data23vert, @@#$3) :: $3 = 2 * remote(Data23vert, @@#$3)

> #+NAME: Data23horiz
> | Descr+ | foo | bar | baz | sum |
> |+-+-+-+-|
> | Data1+ |  12 |  22 |  16 |  50 |
> | Data2+ |  10 |  24 |  17 |  51 |
>
> #+NAME: Calc23horiz-WISH
> | Descr   | foo | bar | baz | sum |
> |-+-+-+-+-|
> | Data2   |  10 |  24 |  17 |  51 |
> | Double  |  20 |  48 |  34 | 102 |
> #+TBLFM: FIXXME

#+NAME: Data23horiz
| Descr+ | foo | bar | baz | sum |
|+-+-+-+-|
| Data1+ |  12 |  22 |  16 |  50 |
| Data2+ |  10 |  24 |  17 |  51 |

| Descr  | foo | bar | baz | sum |
|+-+-+-+-|
| Data2  |  10 |  24 |  17 |  51 |
| Double |  20 |  48 |  34 | 102 |
#+TBLFM: @2$2..@2$5 = remote(Data23horiz, @3$$#) :: @3$2..@3$5 = 2 *
remote(Data23horiz, @3$$#)

Michael



[O] Help on spreadsheet/calc references and improvements

2013-10-05 Thread Karl Voit
Hi!

I am no expert with calc. I enjoy using it for rather
simple things. However, I would like to use referencing more often
and I face an issue here.

Additionally, I got the feeling that some formulas could be improved
as well.

I did a very basic example in two ways: vertical layout and
horizontal layout. The reason for this is, that I got the feeling
that referencing a set of values (not a single cell) differs in
capabilities from rows to columns.

- possible improvements
  - remote reference to multiple cells
  - only one formula for summing up the columns or rows
  - simpler referencing in general?

Headings ending with a plus sign are rows/columns that ought to be
entered manually (as a basis). Others should get calculated or
filled using references. I hope the example is self-explanatory.

Names ending with "-WIST" are tables I would like to get using
formulas. Names ending with "-TRY" are draft versions that
demonstrate referencing issues. Further TBLFM below the TRY versions
contain other attempts.

Feel free to make suggestions how to overcome my lack of knowledge
:-)

Thanks!


#+NAME: Data23vert
| Descr+ | Data1+ | Data2+ |
|++|
| foo| 12 | 10 |
| bar| 22 | 24 |
| baz| 16 | 17 |
|++|
| sum| 50 | 51 |

#+NAME: Calc23vert-WISH
| Descr | Data2 | Double  |
|---+---+-|
| foo   |10 |  20 |
| bar   |24 |  48 |
| baz   |17 |  34 |
|---+---+-|
| sum   |51 | 102 |
#+TBLFM: FIXXME

#+NAME: Calc23vert-TRY
| Descr | Data2 | Double  |
|---+---+-|
| foo   |24 |  48 |
| bar   |24 |  48 |
| baz   |24 |  48 |
|---+---+-|
| sum   |72 | 144 |
#+TBLFM: @I$2..@II$2=subscr(remote(Data23vert, @I$>..@II$>), 
$#)::@I$3..@II$3=$2*2::@5$2=vsum(@I$2..@II$2)::@5$3=vsum(@I$3..@II$3)

#+TBLFM: @I$2..@II$2 = subscr(remote(Data23vert, @I$>..@II$>), $#) 
... results in 24 in each field

(btw, I got the subscr() trick here in the ML but I have to admit
that [1] did not lead to a understanding of it.)

#+TBLFM: @I$2..@II$2 = remote(Data23vert, @I$>..@II$>)
... results in list in each field



#+NAME: Data23horiz
| Descr+ | foo | bar | baz | sum |
|+-+-+-+-|
| Data1+ |  12 |  22 |  16 |  50 |
| Data2+ |  10 |  24 |  17 |  51 |

#+NAME: Calc23horiz-WISH
| Descr   | foo | bar | baz | sum |
|-+-+-+-+-|
| Data2   |  10 |  24 |  17 |  51 |
| Double  |  20 |  48 |  34 | 102 |
#+TBLFM: FIXXME

#+NAME: Calc23horiz-TRY
| Descr   | foo  | bar  | baz  | sum |
|-+--+--+--+-|
| Data2   | [10, 24, 17] | [10, 24, 17] | [10, 24, 17] | |
| Double  |  |  |  | |
#+TBLFM: @2$2..@2$4=remote(Data23horiz, @>$2..@>$4)

#+TBLFM: @2$2..@2$4=subscr(remote(Data23horiz, @>$2..@>$4), $#) 
... 24, 17, list -> WTF?

#+TBLFM: @2$2..@2$4=remote(Data23horiz, @>$2..@>$4)
... three identical lists instead of values

  1. 
https://www.gnu.org/software/emacs/manual/html_node/calc/Extracting-Elements.html
-- 
mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <

https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github