1 = Template Terminology =
6 indexterm:[reports, data types]
8 The information in Evergreen's database can be classified in nine data types, formats that describe the type of data and/or its use. These were represented by text-only labels in prior versions of Evergreen. Evergreen 3.0 has replaced the text labels with icons. When building templates in _Reports_, you will find these icons in the Field Name Pane of the template creation interface.
11 image::media/datatypes_timestamp.png[]
13 An exact date and time (year, month, day, hour, minutes, and seconds). Remember to select the appropriate date/time transform. Raw Data includes second and timezone information, which is usually more than is required for a report.
17 image::media/datatypes_link.png[]
19 A link to another database table. Link outputs a number that is a meaningful reference for the database but not of much use to a human user. You will usually want to drill further down the tree in the Sources pane and select fields from the linked table. However, in some instances you might want to use a link field. For example, to count the number of patrons who borrowed items you could do a count on the Patron link data.
22 image::media/datatypes_text.png[]
24 A field of text. You will usually want to use the Raw Data transform.
27 image::media/datatypes_bool.png[]
29 True or False. Commonly used to filter out deleted item or patron records.
32 image::media/datatypes_orgunit.png[]
34 Organizational Unit - a number representing a library, library system, or federation. When you want to filter on a library, make sure that the field name is on an org_unit or id data type.
38 image::media/datatypes_id.png[]
40 A unique number assigned by the database to identify each record. These numbers are meaningful references for the database but not of much use to a human user. Use in displayed fields when counting records or in filters.
44 image::media/datatypes_money.png[]
50 image::media/datatypes_int.png[]
56 image::media/datatypes_interval.png[]
61 == Field Transforms ==
63 indexterm:[reports, field transforms]
65 A _Field Transform_ tells the reporter how to process a field for output.
66 Different data types have different transform options.
68 indexterm:[reports, field transforms, raw data]
70 *Raw Data*. To display a field exactly as it appears in the database use the
71 _Raw Data_ transform, available for all data types.
73 indexterm:[reports, field transforms, count]
75 indexterm:[reports, field transforms, raw distinct]
77 *Count and Count Distinct*. These transforms apply to the _id_ data type and
78 are used to count database records (e.g. for circulation statistics). Use Count
79 to tally the total number of records. Use _Count Distinct_ to count the number
80 of unique records, removing duplicates.
82 To demonstrate the difference between _Count_ and _Count Distinct_, consider an
83 example where you want to know the number of active patrons in a given month,
84 where ``active" means they borrowed at least one item. Each circulation is linked
85 to a _Patron ID_, a number identifying the patron who borrowed the item. If we use
86 the _Count Distinct_ transform for Patron IDs we will know the number of unique
87 patrons who circulated at least one book (2 patrons in the table below). If
88 instead, we use _Count_, we will know how many books were circulated, since every
89 circulation is linked to a _patron ID_ and duplicate values are also counted. To
90 identify the number of active patrons in this example the _Count Distinct_
91 transform should be used.
93 [options="header,footer"]
94 |====================================
95 |Title |Patron ID |Patron Name
96 |Harry Potter and the Chamber of Secrets |001 |John Doe
97 |Northern Lights |001 |John Doe
98 |Harry Potter and the Philosopher’s Stone |222 |Jane Doe
99 |====================================
101 indexterm:[reports, field transforms, output type]
103 *Output Type*. Note that each transform has either an _Aggregate_ or
104 _Non-Aggregate_ output type.
106 indexterm:[reports, field transforms, output type, non-aggregate]
108 indexterm:[reports, field transforms, output type, aggregate]
110 Selecting a _Non-Aggregate_ output type will return one row of output in your
111 report for each row in the database. Selecting an Aggregate output type will
112 group together several rows of the database and return just one row of output
113 with, say, the average value or the total count for that group. Other common
114 aggregate types include minimum, maximum, and sum.
116 When used as filters, non-aggregate and aggregate types correspond to _Base_ and
117 _Aggregate_ filters respectively. To see the difference between a base filter and
118 an aggregate filter, imagine that you are creating a report to count the number
119 of circulations in January. This would require a base filter to specify the
120 month of interest because the month is a non-aggregate output type. Now imagine
121 that you wish to list all items with more than 25 holds. This would require an
122 aggregate filter on the number of holds per item because you must use an
123 aggregate output type to count the holds.