[gnumeric] add example on using array functions to replace database functions
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] add example on using array functions to replace database functions
- Date: Thu, 1 Dec 2011 21:12:57 +0000 (UTC)
commit cf1385c91f80ef76df3af76bae0538cb379a0bc4
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Thu Dec 1 14:11:25 2011 -0700
add example on using array functions to replace database functions
2011-12-01 Andreas J. Guelzow <aguelzow pyrshep ca>
* data-types.xml: update
* figures/Makefile.am: add formula-dmedian.png
* figures/formula-dmedian.png: new
doc/C/ChangeLog | 6 ++++
doc/C/data-types.xml | 53 +++++++++++++++++++++++++++++++++++++
doc/C/figures/Makefile.am | 1 +
doc/C/figures/formula-dmedian.png | Bin 0 -> 29206 bytes
4 files changed, 60 insertions(+), 0 deletions(-)
---
diff --git a/doc/C/ChangeLog b/doc/C/ChangeLog
index f2347ba..507b0d6 100644
--- a/doc/C/ChangeLog
+++ b/doc/C/ChangeLog
@@ -1,3 +1,9 @@
+2011-12-01 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * data-types.xml: update
+ * figures/Makefile.am: add formula-dmedian.png
+ * figures/formula-dmedian.png: new
+
2011-11-30 Andreas J. Guelzow <aguelzow pyrshep ca>
* data-types.xml: update
diff --git a/doc/C/data-types.xml b/doc/C/data-types.xml
index 652c07e..bf426cf 100644
--- a/doc/C/data-types.xml
+++ b/doc/C/data-types.xml
@@ -837,6 +837,59 @@ FUNCTIONNAME(ARGUMENTS)
</sect3>
+ <sect3 id="sect-data-formulas-database">
+ <title>Database Formulas</title>
+ <para>
+ Solely for compatibility with Excel and ODF files, &gnum; supports various database functions:
+ <xref linkend="gnumeric-function-DAVERAGE" />,
+ <xref linkend="gnumeric-function-DCOUNT" />,
+ <xref linkend="gnumeric-function-DCOUNTA" />,
+ <xref linkend="gnumeric-function-DGET" />,
+ <xref linkend="gnumeric-function-DMAX" />,
+ <xref linkend="gnumeric-function-DMIN" />,
+ <xref linkend="gnumeric-function-DPRODUCT" />,
+ <xref linkend="gnumeric-function-DSTDEV" />,
+ <xref linkend="gnumeric-function-DSTDEVP" />,
+ <xref linkend="gnumeric-function-DSUM" />,
+ <xref linkend="gnumeric-function-DVAR" /> and
+ <xref linkend="gnumeric-function-DVARP" />.
+ </para>
+ <para>
+ Since these functions are quite restrictive on the criteria that can be used, it is often
+ easier to use array functions as described in <xref linkend="sect-data-formulas-array" />.
+ Array functions are also useful in the case that a specific database function does not exist:
+ </para>
+
+ <example id="dmedian">
+ <title>Simulating <code>DMEDIAN</code> with an Array Function</title>
+ <para>
+ As shown in <xref linkend="dmedian-example-1" />, instead of using (the non-existing)
+ function <code>DMEDIAN</code> one can use the alternative expression
+ <code>median(if(A1:A20="AA",B1:B2))</code> entered as an array function as described in
+ <xref linkend="sect-data-formulas-array" />. Multiple conditions can be combined using
+ the <code>AND</code> or <code>OR</code> functions as in
+ <code>median(if(OR(A1:A20="AA",A1:A20="BB"),B1:B20))</code>.
+ Using defined names as introduced in <xref linkend="sect-data-formulas-names" /> for
+ <code>A1:A20</code> and <code>B1:B20</code> can make this code very flexible and readable.
+ </para>
+ </example>
+
+ <figure id="dmedian-example-1">
+ <title>Calculating the MEDIAN of Some Data Values</title>
+ <screenshot>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="figures/formula-dmedian.png"
+ format="PNG" />
+ </imageobject>
+ <textobject>
+ <phrase>Calculating the MEDIAN of some data values.</phrase>
+ </textobject>
+ </mediaobject>
+ </screenshot>
+ </figure>
+
+ </sect3>
</sect2>
diff --git a/doc/C/figures/Makefile.am b/doc/C/figures/Makefile.am
index 6966b96..b1c68fd 100644
--- a/doc/C/figures/Makefile.am
+++ b/doc/C/figures/Makefile.am
@@ -227,6 +227,7 @@ EXTRA_DIST = \
files-html-example.png \
files-html32-example.png \
files-html40-example.png \
+ formula-dmedian.png \
gnumeric-icon-24.png \
gnumeric-labelled.png \
gnumeric-power-example.png \
diff --git a/doc/C/figures/formula-dmedian.png b/doc/C/figures/formula-dmedian.png
new file mode 100644
index 0000000..bf29d08
Binary files /dev/null and b/doc/C/figures/formula-dmedian.png differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]