Add file for 1.6 branch.
[Evergreen-DocBook.git] / reports / report-template-terminology.xml
diff --git a/reports/report-template-terminology.xml b/reports/report-template-terminology.xml
new file mode 100644 (file)
index 0000000..808e22e
--- /dev/null
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<chapter xml:id="template-terminology" xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="EN"\r
+    xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink">\r
+    <info>\r
+        <title>Template Terminology</title>\r
+    </info>\r
+    <para> </para> \r
+    <simplesect xml:id="create-template-datatypes">\r
+        <info>\r
+            <title>Data Types</title>\r
+        </info> \r
+        <informalfigure> <para>The central column of the <guilabel>Database Source Browser</guilabel> lists\r
+            <guilabel>Field Name</guilabel> and <guilabel>Data Type</guilabel> for the\r
+            selected database table. </para>\r
+            <para><mediaobject>\r
+                <imageobject>\r
+                    <imagedata scalefit="0" fileref="../media/create-template-33.png"/>\r
+                </imageobject>       \r
+            </mediaobject></para>   \r
+        </informalfigure>\r
+        <para>Each data type has its own characteristics and uses:</para>\r
+        <informaltable>\r
+            <tgroup cols="3" align="left" colsep="1" rowsep="1">\r
+                <colspec colnum="1" colname="type" colwidth="1.0*"/>\r
+                <colspec colnum="2" colname="description" colwidth="1.0*"/>\r
+                <colspec colnum="3" colname="notes" colwidth="2.0*"/>\r
+                <thead>\r
+                    <row>\r
+                        <entry>Data Type</entry>\r
+                        <entry>Description</entry>\r
+                        <entry>Notes</entry>\r
+                    </row>\r
+                </thead>\r
+                <tbody>\r
+                    <row>\r
+                        <entry>id</entry>\r
+                        <entry>Unique number assigned by the database to identify a\r
+                            record</entry>\r
+                        <entry>A number that is a meaningful reference for the database but not of much use to a human user.  Use in <guilabel>displayed fields</guilabel> when counting\r
+                            records or in filters.</entry>\r
+                    </row>\r
+                    <row>\r
+                        <entry>text</entry>\r
+                        <entry>Text field</entry>\r
+                        <entry>Usually uses the <guilabel>Raw Data</guilabel> transform.</entry>\r
+                    </row>\r
+                    <row>\r
+                        <entry>timestamp</entry>\r
+                        <entry>Exact date and time</entry>\r
+                        <entry>Select appropriate date/time transform. <guilabel>Raw\r
+                            Data</guilabel> includes second and timezone information, usually more than is required for a report.</entry>\r
+                    </row>\r
+                    <row>\r
+                        <entry>bool</entry>\r
+                        <entry>True or False</entry>\r
+                        <entry>Commonly used to filter out deleted item or patron records.</entry>\r
+                    </row>\r
+                    <row>\r
+                        <entry>org_unit</entry>\r
+                        <entry>A number representing a library, library system, or\r
+                            federation</entry>\r
+                        <entry>When you want to filter on a library, make sure that the field\r
+                            name is on an <guilabel>org_unit</guilabel> or <guilabel>id</guilabel> data type.</entry>\r
+                    </row>\r
+                    <row>\r
+                        <entry>link</entry>\r
+                        <entry>A link to another database table</entry>\r
+                        <entry><guilabel>Link</guilabel> outputs a number that is a meaningful\r
+                            reference for the database but not of much use to a human user. You\r
+                            will usually want to drill further down the tree in the\r
+                            <guilabel>Sources</guilabel> pane and select fields from the\r
+                            linked table. However, in some instances you might\r
+                            want to use a <guilabel>link</guilabel> field.  For example, to count the number of patrons who borrowed items you could do\r
+                            a count on the <guilabel>Patron</guilabel> <guilabel>link</guilabel> data.</entry>\r
+                    </row>\r
+                    <row>\r
+                        <entry>int</entry>\r
+                        <entry>Integer</entry>\r
+                        <entry/>\r
+                    </row>\r
+                    <row>\r
+                        <entry>money</entry>\r
+                        <entry>Number (in dollars)</entry>\r
+                        <entry/>\r
+                    </row>\r
+                </tbody>\r
+            </tgroup>\r
+        </informaltable>\r
+    </simplesect>\r
+    <simplesect xml:id="create-template-transforms">\r
+        <info>\r
+            <title>Field Transforms</title>\r
+        </info>\r
+        <informalfigure> <para>A <guilabel>Field Transform</guilabel> tells the reporter how to process a field\r
+            for output. Different data types have different transform options. </para>\r
+            <para> <mediaobject>\r
+                <imageobject>\r
+                    <imagedata scalefit="0" fileref="../media/create-template-34.png"/>\r
+                </imageobject>\r
+            </mediaobject></para></informalfigure>\r
+        \r
+        \r
+        <formalpara><title>Raw Data</title><para> To display a field exactly as it appears in\r
+            the database use the <guilabel>Raw Data</guilabel> transform, available for all data\r
+            types.</para></formalpara>\r
+        \r
+        <formalpara><title><guilabel>Count</guilabel> and <guilabel>Count Distinct</guilabel></title><para> These transforms\r
+            apply to the <guilabel>id</guilabel> data type and are used to count database\r
+            records (e.g. for circulation statistics). Use <guimenuitem>Count</guimenuitem> to\r
+            tally the total number of records. Use <guilabel>Count Distinct</guilabel> to count\r
+            the number of unique records, removing duplicates. </para></formalpara>\r
+        <para>To demonstrate the difference between <guilabel>Count</guilabel> and\r
+            <guilabel>Count Distinct</guilabel>, consider an example where you want to know\r
+            the number of active patrons in a given month, where <emphasis>active</emphasis>\r
+            means they borrowed at least one item. Each circulation is linked to a Patron ID, a\r
+            number identifying the patron who borrowed the item. If we use the <guilabel>Count\r
+                Distinct</guilabel> transform for Patron IDs we will know the number of unique\r
+            patrons who circulated at least one book (2 patrons in the table below). If instead,\r
+            we use <guilabel>Count</guilabel>, we will know how many books were circulated,\r
+            since every circulation is linked to a patron ID and duplicate values are also\r
+            counted. To identify the number of active patrons in this example the\r
+            <guilabel>Count Distinct</guilabel> transform should be used.</para>\r
+        \r
+        <informaltable>\r
+            \r
+            <tgroup cols="3" align="left" colsep="1" rowsep="1">\r
+                <colspec colnum="1" colname="title" colwidth="2.0*"/>\r
+                <colspec colnum="2" colname="id" colwidth="1.0*"/>\r
+                <colspec colnum="3" colname="name" colwidth="1.0*"/>\r
+                \r
+                <thead>\r
+                    <row>\r
+                        <entry>Title</entry>\r
+                        <entry> Patron ID</entry>\r
+                        <entry> Patron Name</entry>\r
+                    </row>\r
+                </thead>\r
+                <tbody>\r
+                    <row>\r
+                        <entry> Harry Potter and the Chamber of Secrets</entry>\r
+                        <entry> 001</entry>\r
+                        <entry> John Doe</entry>\r
+                    </row>\r
+                    \r
+                    <row>\r
+                        <entry> Northern Lights</entry>\r
+                        <entry> 001</entry>\r
+                        <entry> John Doe</entry>\r
+                    </row>\r
+                    <row>\r
+                        <entry> Harry Potter and the Philosopher’s Stone</entry>\r
+                        <entry> 222</entry>\r
+                        <entry> Jane Doe</entry>\r
+                    </row>\r
+                    \r
+                </tbody>\r
+            </tgroup>\r
+        </informaltable> \r
+        <informalfigure>\r
+            <formalpara><title>Output Type</title><para> Note that each transform has either an <guilabel>Aggregate</guilabel> or\r
+                <guilabel>Non-Aggregate</guilabel> output type. </para></formalpara>\r
+            \r
+            <para> <mediaobject>\r
+                <imageobject>\r
+                    <imagedata scalefit="0" fileref="../media/create-template-35.png"/>\r
+                </imageobject>\r
+            </mediaobject></para>\r
+        </informalfigure>\r
+        <para> Selecting a <guilabel>Non-Aggregate</guilabel> output type will return one row of\r
+            output in your report for each row in the database. Selecting an\r
+            <guilabel>Aggregate</guilabel> output type will group together several rows of\r
+            the database and return just one row of output with, say, the average value or the\r
+            total count for that group. Other common aggregate types include minimum, maximum,\r
+            and sum. </para>\r
+        <para>When used as filters, non-aggregate and aggregate types correspond to <guilabel>Base</guilabel> and <guilabel>Aggregate</guilabel> filters respectively.  To see the difference between a base filter and an aggregate filter, imagine that\r
+            you are creating a report to count the number of circulations in January. This would\r
+            require a base filter to specify the month of interest because the month is a\r
+            non-aggregate output type. Now imagine that you wish to list all items with more\r
+            than 25 holds. This would require an aggregate filter on the number of holds per\r
+            item because you must use an aggregate output type to count the holds.</para> \r
+    </simplesect>  \r
+</chapter>\r