]> git.evergreen-ils.org Git - working/Evergreen.git/blob - docs/reports/reporter_template_terminology.adoc
LP#1514085: add to release notes with a server configuration note
[working/Evergreen.git] / docs / reports / reporter_template_terminology.adoc
1 Template Terminology
2 --------------------
3
4 Data Types
5 ~~~~~~~~~~
6
7 indexterm:[reports, data types]
8
9 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.
10
11 timestamp
12 ^^^^^^^^^
13 image::media/datatypes_timestamp.png[]
14
15 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.
16
17 link
18 ^^^^
19
20 image::media/datatypes_link.png[]
21
22 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.
23
24 text
25 ^^^^
26 image::media/datatypes_text.png[]
27
28 A field of text. You will usually want to use the Raw Data transform.
29
30 bool
31 ^^^^
32 image::media/datatypes_bool.png[]
33
34 True or False. Commonly used to filter out deleted item or patron records.
35
36 org_unit
37 ^^^^^^^^
38 image::media/datatypes_orgunit.png[]
39
40 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.
41
42 id
43 ^^
44
45 image::media/datatypes_id.png[]
46
47 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.
48
49 money
50 ^^^^^
51
52 image::media/datatypes_money.png[]
53
54 A monetary amount.
55
56 int
57 ^^^
58
59 image::media/datatypes_int.png[]
60
61 Integer (a number)
62
63 interval
64 ^^^^^^^^
65
66 image::media/datatypes_interval.png[]
67
68 A period of time.
69
70 [[field_transforms]]
71 Field Transforms
72 ~~~~~~~~~~~~~~~~
73
74 indexterm:[reports, field transforms]
75
76 A _Field Transform_ tells the reporter how to process a field for output. 
77 Different data types have different transform options.
78
79 indexterm:[reports, field transforms, raw data]
80
81 *Raw Data*.  To display a field exactly as it appears in the database use the 
82 _Raw Data_ transform, available for all data types.
83
84 indexterm:[reports, field transforms, count]
85
86 indexterm:[reports, field transforms, raw distinct]
87
88 *Count and Count Distinct*.  These transforms apply to the _id_ data type and 
89 are used to count database records (e.g. for circulation statistics). Use Count 
90 to tally the total number of records. Use _Count Distinct_ to count the number 
91 of unique records, removing duplicates.
92
93 To demonstrate the difference between _Count_ and _Count Distinct_, consider an 
94 example where you want to know the number of active patrons in a given month, 
95 where ``active" means they borrowed at least one item. Each circulation is linked 
96 to a _Patron ID_, a number identifying the patron who borrowed the item. If we use 
97 the _Count Distinct_ transform for Patron IDs we will know the number of unique 
98 patrons who circulated at least one book (2 patrons in the table below). If 
99 instead, we use _Count_, we will know how many books were circulated, since every 
100 circulation is linked to a _patron ID_ and duplicate values are also counted. To 
101 identify the number of active patrons in this example the _Count Distinct_ 
102 transform should be used.
103
104 [options="header,footer"]
105 |====================================
106 |Title  |Patron ID      |Patron Name
107 |Harry Potter and the Chamber of Secrets        |001    |John Doe
108 |Northern Lights        |001    |John Doe
109 |Harry Potter and the Philosopher’s Stone     |222    |Jane Doe
110 |====================================
111
112 indexterm:[reports, field transforms, output type]
113
114 *Output Type*.  Note that each transform has either an _Aggregate_ or 
115 _Non-Aggregate_ output type.
116
117 indexterm:[reports, field transforms, output type, non-aggregate]
118
119 indexterm:[reports, field transforms, output type, aggregate]
120
121 Selecting a _Non-Aggregate_ output type will return one row of output in your 
122 report for each row in the database. Selecting an Aggregate output type will 
123 group together several rows of the database and return just one row of output 
124 with, say, the average value or the total count for that group. Other common 
125 aggregate types include minimum, maximum, and sum.
126
127 When used as filters, non-aggregate and aggregate types correspond to _Base_ and 
128 _Aggregate_ filters respectively. To see the difference between a base filter and 
129 an aggregate filter, imagine that you are creating a report to count the number 
130 of circulations in January. This would require a base filter to specify the 
131 month of interest because the month is a non-aggregate output type. Now imagine 
132 that you wish to list all items with more than 25 holds. This would require an 
133 aggregate filter on the number of holds per item because you must use an 
134 aggregate output type to count the holds.
135