]> git.evergreen-ils.org Git - Evergreen.git/blob - docs-antora/modules/reports/pages/reporter_template_terminology.adoc
LP#1848524: Docs: Fix sections for Antora: "reports"
[Evergreen.git] / docs-antora / modules / reports / pages / reporter_template_terminology.adoc
1 = Template Terminology =
2 :toc:
3
4 == Data Types ==
5
6 indexterm:[reports, data types]
7
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.
9
10 === timestamp ===
11 image::media/datatypes_timestamp.png[]
12
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.
14
15 === link ===
16
17 image::media/datatypes_link.png[]
18
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.
20
21 === text ===
22 image::media/datatypes_text.png[]
23
24 A field of text. You will usually want to use the Raw Data transform.
25
26 === bool ===
27 image::media/datatypes_bool.png[]
28
29 True or False. Commonly used to filter out deleted item or patron records.
30
31 === org_unit ===
32 image::media/datatypes_orgunit.png[]
33
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.
35
36 === id ===
37
38 image::media/datatypes_id.png[]
39
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.
41
42 === money ===
43
44 image::media/datatypes_money.png[]
45
46 A monetary amount.
47
48 === int ===
49
50 image::media/datatypes_int.png[]
51
52 Integer (a number)
53
54 === interval ===
55
56 image::media/datatypes_interval.png[]
57
58 A period of time.
59
60 [[field_transforms]]
61 == Field Transforms ==
62
63 indexterm:[reports, field transforms]
64
65 A _Field Transform_ tells the reporter how to process a field for output. 
66 Different data types have different transform options.
67
68 indexterm:[reports, field transforms, raw data]
69
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.
72
73 indexterm:[reports, field transforms, count]
74
75 indexterm:[reports, field transforms, raw distinct]
76
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.
81
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.
92
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 |====================================
100
101 indexterm:[reports, field transforms, output type]
102
103 *Output Type*.  Note that each transform has either an _Aggregate_ or 
104 _Non-Aggregate_ output type.
105
106 indexterm:[reports, field transforms, output type, non-aggregate]
107
108 indexterm:[reports, field transforms, output type, aggregate]
109
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.
115
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.
124