fixed word error that resulted from copy and paste
[migration-tools.git] / mig-xml / excel_mapping_reports.xml
1 <reports_file>
2 <!-- sample reports entry
3     <report>
4         <name>name of report</name>
5         <iteration value='0' /> which version, the first version to run is 0, first backup is 1, then so on
6         <tag>money</tag>  arbitrary tags, each should go in separate tag
7         <report_title>Migrated Billings</report_title>  title used in the asciidoc output
8         <heading column='1'>Number of Billings.Migrated.Total</heading> period delimited 
9         <query>SELECT COUNT(id),x_migrate,SUM(amount) FROM money_billing_legacy GROUP BY 2;</query>  query itself, will be replaced
10         <note>Arbitrary note that can be included in the entries.</note>
11     </report>
12 -->
13
14    <!-- evergreen -->
15
16     <report>
17         <name>evg_asset_copy_statuses</name>
18         <report_title>Statuses</report_title>
19         <tag>evergreen</tag>
20         <iteration>0</iteration>
21         <heading>Copy Count.Migrating Status.New Evergreen Status.Notes</heading>
22         <query>SELECT COUNT(ac.l_id), cs.l_name FROM asset_copy_legacy ac JOIN config_copy_status_legacy cs ON cs.l_id = ac.l_status GROUP BY 2 ORDER BY 2</query>
23         <note>You only need to fill this sheet out if you use custom statuses that need to be migrated.</note>
24     </report>
25
26     <report>
27         <name>evg_asset_circ_mods</name>
28         <report_title>Circulation Modifiers</report_title>
29         <tag>evergreen</tag>
30         <iteration>0</iteration>
31         <heading>Copy Count.Migrating Circ Mod.New Circ Mod.Notes</heading>
32         <query>SELECT COUNT(ac.l_id), ac.l_circ_modifier FROM asset_copy_legacy ac GROUP BY 2 ORDER BY 2</query>
33     </report>
34
35     <report>
36         <name>evg_asset_copy_locs</name>
37         <report_title>Copy Locations</report_title>
38         <tag>evergreen</tag>
39         <iteration>0</iteration>
40         <heading>Count.Library.Migrating Copy Location.New Copy Location.Notes</heading>
41         <query>SELECT COUNT(ac.l_id), aou.l_name, acl.l_name FROM asset_copy_location_legacy acl JOIN actor_org_unit_legacy aou ON aou.l_id = acl.l_owning_lib JOIN asset_copy_legacy ac ON ac.l_location = acl.l_id GROUP BY 2, 3 ORDER BY 2, 3</query>
42         <note>Any locations not mapped can be moved over as their existing locations.</note>
43     </report>
44
45    <report>
46         <name>evg_permission_grps</name>
47         <report_title>Permission Groups</report_title>
48         <tag>evergreen</tag>
49         <iteration>0</iteration>
50         <heading>Count.Migrating Permission Group.New Permission Group.Notes</heading>
51         <query>SELECT COUNT(au.l_id), pgt.l_name FROM actor_usr_legacy au JOIN permission_grp_tree_legacy pgt ON pgt.l_id = au.l_profile GROUP BY 2 ORDER BY 2</query>
52     </report>
53
54     <!-- tlc -->
55     <report>
56         <name>tlc_load_branches_list</name>
57         <tag>tlc</tag>
58         <iteration>0</iteration>
59         <report_title>Branches Present in Extract</report_title>
60         <heading>Name.Evergreen Org Unit.Notes</heading>
61         <query>SELECT l_name FROM ctbranches_tsv_clean ORDER BY 1</query>
62     </report>
63
64     <report>
65         <name>tlc_load_asset_notes</name>
66         <report_title>Item Notes</report_title>
67         <tag>tlc</tag>
68         <iteration>0</iteration>
69         <heading>Count.Note Type.Notes</heading>
70         <query>SELECT COUNT(l_itemcomment), 'Item Comments' FROM ititeminformation_tsv_clean WHERE l_itemcomment IS NOT NULL GROUP BY 2
71                UNION ALL SELECT COUNT(l_physicalcondition), 'Condition Notes' FROM ctlocitem_tsv_clean WHERE l_physicalcondition IS NOT NULL GROUP BY 2
72                UNION ALL SELECT COUNT(l_checkinoutnote), 'Circ Notes' FROM ctlocitem_tsv_clean WHERE l_checkinoutnote IS NOT NULL GROUP BY 2
73          </query>
74     </report>
75
76     <report>
77         <name>tlc_load_asset_holdings_codes</name>
78         <report_title>Holdings Codes</report_title>
79         <tag>tlc</tag>
80         <iteration>0</iteration>
81         <heading>Count.Holdings Codes.Evergreen Circulation Modifier.Evergreen Shelving Locatione</heading>
82         <query>SELECT COUNT(l_barcode), l_activeholdingscode FROM ctlocitem_tsv_clean GROUP BY 2 ORDER BY 2</query>
83     </report>
84 <!--
85     <report>
86         <name>tlc_load_asset_callnumbertype</name>
87         <report_title>Call Number Types</report_title>
88         <tag>tlc</tag>
89         <iteration>0</iteration>
90         <heading>Copy Count.Call Number Type.Evergreen Call Number Type.Notes</heading>
91         <query>SELECT COUNT(l_barcode), l_callnumbertype FROM ctlocitem_tsv_clean GROUP BY 2 ORDER BY 2</query>
92         <note>Mappable to generic, LoC and Dewey types in Evergreen.</note>
93     </report>
94 -->
95 <!-- 
96     <report>
97         <name>tlc_load_asset_callnumberparts</name>
98         <report_title>Call Number Parts</report_title>
99         <tag>tlc</tag>
100         <iteration>0</iteration>
101         <heading>Copy Count.Call Number Part.Evergreen Sequence.Evergreen Call Number Part.Delimiter</heading>
102         <query>SELECT COUNT(l_barcode) FROM ctlocitem_tsv_clean, 'Prefixes' WHERE l_callnumberprefix IS NOT NULL GROUP BY 1 UNION ALL SELECT 'Class Label', COUNT(l_barcode) FROM ctlocitem_tsv_clean WHERE l_callnumberclass IS NOT NULL GROUP BY 1 UNION ALL SELECT 'Cutter', COUNT(l_barcode) FROM ctlocitem_tsv_clean WHERE l_callnumbercutter IS NOT NULL GROUP BY 1 UNION ALL SELECT 'Year', COUNT(l_barcode) FROM ctlocitem_tsv_clean WHERE l_year IS NOT NULL GROUP BY 1 UNION ALL SELECT 'Volume', COUNT(l_barcode) FROM ctlocitem_tsv_clean WHERE l_volume IS NOT NULL GROUP BY 1</query>
103     </report>
104 -->
105     <report>
106         <name>tlc_load_money_migrating_bills</name>
107         <report_title>Migrating Bills By Bill Type</report_title>
108         <tag>tlc</tag>
109         <iteration>0</iteration>
110         <heading>Count.Billing Type.Evergreen Bill Type</heading>
111         <query>SELECT COUNT(a.l_chargenumber), b.l_description FROM itpayment_tsv_clean a JOIN itpaymenttype_tsv_clean b ON b.l_paymenttype = a.l_paymenttype WHERE a.l_dueamount::INTEGER - (a.l_waiveamount::INTEGER + a.l_tenderamount::INTEGER) > 0 GROUP BY 2 ORDER BY 2 </query>
112     </report>
113
114     <report>
115         <name>tlc_load_usrs_bygroup</name>
116         <report_title>Patrons by Agency Type</report_title>
117         <tag>tlc</tag>
118         <iteration>0</iteration>
119         <heading>Count.Permission Group.Evergreen Permission Group</heading>
120         <query>SELECT COUNT(l_agencynumber), l_agencytype FROM itagency_tsv_clean GROUP BY 2 ORDER BY 2</query>
121     </report>
122
123     <report>
124         <name>tlc_load_usrs_byexpiration</name>
125         <report_title>Patrons by Expiration Date</report_title>
126         <tag>tlc</tag>
127         <iteration>0</iteration>
128         <heading>Count.Year of Expiration.Do Not Migrate?</heading>
129         <query>SELECT COUNT(l_agencynumber), LEFT(l_expirationdate,4) FROM itagency_tsv_clean GROUP BY 2 ORDER BY 2</query>
130     </report>
131 <!--
132     <report>
133         <name>tlc_load_usrs_bynever</name>
134         <report_title>Patrons With Claims</report_title>
135         <tag>tlc</tag>
136         <iteration>0</iteration>
137         <heading>Count.Claim Type.Do Not Migrate</heading>
138         <query>SELECT COUNT(l_agencynumber) FROM itagency_tsv_clean, 'Never Checked Out' WHERE l_itemsclaimednevercheckedout != '0' GROUP BY 1 UNION ALL SELECT COUNT(l_agencynumber), 'Claims Returned' FROM itagency_tsv_clean WHERE l_itemsclaimedreturned != '0' GROUP BY 1</query>
139     </report>
140 -->
141     <report>
142         <name>tlc_load_usrs_byactive</name>
143         <report_title>Patrons by Last Active Date</report_title>
144         <tag>tlc</tag>
145         <iteration>0</iteration>
146         <heading>Count.Year Last Active.Migrate as Active Flag?</heading>
147         <query>SELECT COUNT(l_agencynumber), LEFT(l_lastactivedate,4) FROM itagency_tsv_clean GROUP BY 2 ORDER BY 2</query>
148         <note>We can set the active flag based on this if desired.</note>
149     </report>
150
151     <report>
152         <name>tlc_load_usrs_blocks</name>
153         <report_title>Patrons by Block Status</report_title>
154         <tag>tlc</tag>
155         <iteration>0</iteration>
156         <heading>Count.Block Status.Migration Note</heading>
157         <query>SELECT COUNT(l_agencynumber), l_blockstatus FROM itagency_tsv_clean GROUP BY 2 ORDER BY 2</query>
158     </report>
159
160     <report>
161         <name>tlc_load_usrs_gender</name>
162         <report_title>Patrons by Gender</report_title>
163         <tag>tlc</tag>
164         <iteration>0</iteration>
165         <heading>Count.Gender.Migrate as Stat Cat</heading>
166         <query>SELECT COUNT(l_agencynumber), l_gender FROM itagency_tsv_clean GROUP BY 2 ORDER BY 2</query>
167         <note>Evergreen can load these as statistical categories</note>
168     </report>
169
170     <report>
171         <name>tlc_load_active_usr_passwords</name>
172         <report_title>Count of Patrons w Passwords</report_title>
173         <tag>tlc</tag>
174         <iteration>0</iteration>
175         <heading>Count of NULL PINs.Default Password</heading>
176         <query>SELECT COUNT(l_agencynumber) FROM itagency_tsv_clean WHERE l_pin IS NULL</query>
177         <note>If any PINS are blank we will have to choose a method to supply them as Evergreen requires passwords.</note>
178     </report>
179
180    <report>
181         <name>tlc_load_usr_notes</name>
182         <report_title>Count of Patron Notes</report_title>
183         <tag>tlc</tag>
184         <iteration>0</iteration>
185         <heading>Count.Note Type.Action</heading>
186         <query>SELECT COUNT(l_agencynumber), 'Patron Note' FROM itagency_tsv_clean WHERE l_agencycomment IS  NOT NULL UNION ALL SELECT COUNT(l_agencynumber), 'Address Comments' FROM itaddress_tsv_clean WHERE l_addresscomment IS NOT NULL</query>
187     </report>
188     
189     <report>
190         <name>tlc_load_usr_balance</name>
191         <report_title>Count and Sum of Balances</report_title>
192         <tag>tlc</tag>
193         <iteration>0</iteration>
194         <heading>Count.SUM in Pennies.Migrate?</heading>
195         <query>SELECT COUNT(l_agencynumber), SUM(l_accountbalance::INTEGER) FROM itagency_tsv_clean WHERE l_accountbalance != '0'</query>
196         <note>If this is being migrated there are a few options of how to do it and each will have different workflows.</note>
197     </report>
198
199     <report>
200         <name>tlc_load_usr_addresses_phones</name>
201         <report_title>Patron Phones</report_title>
202         <tag>tlc</tag>
203         <iteration>0</iteration>
204         <heading>Count.Phone Type.Phone Type</heading>
205         <query>SELECT COUNT(l_phone1), 'Phone 1' FROM itaddress_tsv_clean WHERE l_phone1 IS NOT NULL GROUP BY 2 UNION ALL SELECT COUNT(l_phone1), 'Phone 2' FROM itaddress_tsv_clean WHERE l_phone2 IS NOT NULL GROUP BY 2</query>
206         <note>These need to be mounted to Evergreen phone fields.</note>
207     </report>
208
209     <report>
210          <name>tlc_load_usr_stat_cats</name>
211         <report_title>Patron Stat Cats and Counts</report_title>
212         <tag>tlc</tag>
213         <iteration>0</iteration>
214         <heading>Patron Count.Stat Cat.Migrate?</heading>
215         <query>SELECT COUNT(b.l_agencynumber), a.l_description FROM itagencyfields_tsv_clean a JOIN itagencydata_tsv_clean b ON b.l_agencyfieldnumber = a.l_agencyfieldnumber GROUP BY 2 ORDER BY 1</query>
216     </report>
217
218 <!-- destiny -->
219
220     <report>
221         <name>destiny_load_usr_by_gradelevel</name>
222         <report_title>Patrons by Destiny Grade Level</report_title>
223         <tag>destiny</tag>
224         <iteration>0</iteration>
225         <heading>Count.Graduation Year</heading>
226         <query>SELECT COUNT(*), grade_level FROM patrons_csv GROUP BY 2 ORDER BY 2</query>
227         <note>Transfer to note or stat cat?</note>
228     </report>
229     
230         <report>
231         <name>destiny_load_usr_by_gender</name>
232         <report_title>Patrons by Destiny Gender</report_title>
233         <tag>destiny</tag>
234         <iteration>0</iteration>
235         <heading>Count.Gender</heading>
236         <query>SELECT COUNT(*), gender FROM patrons_csv GROUP BY 2 ORDER BY 2</query>
237         <note>Transfer to stat cat?</note>
238     </report>
239     
240         <report>
241         <name>destiny_load_usr_by_patrontype</name>
242         <report_title>Patrons by Destiny Patron Type</report_title>
243         <tag>destiny</tag>
244         <iteration>0</iteration>
245         <heading>Count.Patron Type.Permission Group</heading>
246         <query>SELECT COUNT(*), patron_type FROM patrons_csv GROUP BY 2 ORDER BY 2</query>
247     </report>
248     
249     <report>
250         <name>destiny_load_usr_by_status</name>
251         <report_title>Patrons by Destiny Status</report_title>
252         <tag>destiny</tag>
253         <iteration>0</iteration>
254         <heading>Count.Status</heading>
255         <query>SELECT COUNT(*), status FROM patrons_csv GROUP BY 2 ORDER BY 2</query>
256     </report>
257     
258     <report>
259         <name>destiny_load_usr_by_municipality</name>
260         <report_title>Patrons by Municipality</report_title>
261         <tag>destiny</tag>
262         <iteration>0</iteration>
263         <heading>Count.Municipality</heading>
264         <query>SELECT COUNT(*), municipality FROM patrons_csv GROUP BY 2 ORDER BY 2</query>
265         <note>State cat?</note>
266     </report>
267     
268     <report>
269         <name>destiny_load_usr_notes</name>
270         <report_title>Types of and Counts of Notes</report_title>
271         <tag>destiny</tag>
272         <iteration>0</iteration>
273         <heading>Type of Note.Count</heading>
274         <query>SELECT 'General Note', COUNT(*) FROM patrons_csv WHERE note_general IS NOT NULL and note_general != '' UNION ALL SELECT 'Important Note', COUNT(*) FROM patrons_csv WHERE note_important IS NOT NULL and note_important != '' </query>
275         <note>Messsage / alert / note?</note>
276     </report>
277     
278     <report>
279         <name>destiny_load_usr_userdefined5</name>
280         <report_title>User Defined Field 5</report_title>
281         <tag>destiny</tag>
282         <iteration>0</iteration>
283         <heading>Count.Values</heading>
284         <query>SELECT COUNT(*), user_defined_5 FROM patrons_csv GROUP BY 2 ORDER BY 2</query>
285         <note>Retain somewhere?</note>
286     </report>
287     
288     <report>
289         <name>destiny_load_usrs_pswdconfigured</name>
290         <report_title>Patrons by Password Configured</report_title>
291         <tag>destiny</tag>
292         <iteration>0</iteration>
293         <heading>Count.Password Configured</heading>
294         <query>SELECT COUNT(*), password_configured FROM patrons_csv GROUP BY 2 ORDER BY 2</query>
295         <note>Need how they want passwords set since we don't have them to migrate and do they want these that are configured with some special note?</note>
296     </report>
297
298     <report>
299         <name>destiny_load_usrs_phonefields</name>
300         <report_title>Phone Fields</report_title>
301         <tag>destiny</tag>
302         <iteration>0</iteration>
303         <heading>Phone Field.Count.Evergreen Phone Field</heading>
304         <query>SELECT 'Primary Phone 1', COUNT(*) FROM patrons_csv WHERE primary_phone_1 IS NOT NULL AND primary_phone_1 != '' UNION ALL SELECT 'Primary Phone 2', COUNT(*) FROM patrons_csv WHERE primary_phone_2 IS NOT NULL AND primary_phone_2 != '' UNION ALL SELECT 'Secondary Phone 1', COUNT(*) FROM patrons_csv WHERE secondary_phone_1 IS NOT NULL AND secondary_phone_1 != '' UNION ALL SELECT 'Secondary Phone 2', COUNT(*) FROM patrons_csv WHERE secondary_phone_2 IS NOT NULL AND secondary_phone_2 != '' </query>
305     </report>
306     
307     <report>
308         <name>destiny_load_asset_categories</name>
309         <report_title>Count of Categories</report_title>
310         <tag>destiny</tag>
311         <iteration>0</iteration>
312         <heading>Count.Category.Circ Mod?</heading>
313         <query>SELECT COUNT(*), category FROM copies_csv GROUP BY 2 ORDER BY 2</query>
314     </report>
315     
316     <report>
317         <name>destiny_load_asset_notes</name>
318         <report_title>Copies by Note Types</report_title>
319         <tag>destiny</tag>
320         <iteration>0</iteration>
321         <heading>Note Type.Count</heading>
322         <query>SELECT 'General Note', COUNT(*) FROM copies_csv WHERE note_general IS NOT NULL and note_general != '' UNION ALL SELECT 'Important Note', COUNT(*) FROM copies_csv WHERE note_important IS NOT NULL and note_important != ''</query>
323         <note>Retain?</note>
324     </report>
325     
326         <report>
327         <name>destiny_load_asset_sublocation</name>
328         <report_title>Copies by Sub Location</report_title>
329         <tag>destiny</tag>
330         <iteration>0</iteration>
331         <heading>Count.Sub Location.Shelving Location?</heading>
332         <query>SELECT COUNT(*), sublocation FROM copies_csv GROUP BY 2 ORDER BY 2</query>
333     </report>
334     
335     <report>
336         <name>destiny_load_asset_vendor</name>
337         <report_title>Copies by Vendor</report_title>
338         <tag>destiny</tag>
339         <iteration>0</iteration>
340         <heading>Count.Vendor</heading>
341         <query>SELECT COUNT(*), vendor FROM copies_csv GROUP BY 2 ORDER BY 2</query>
342         <note>Retain?</note>
343     </report>
344     
345     <report>
346         <name>destiny_load_asset_descriptions</name>
347         <report_title>Copies with Description Fields</report_title>
348         <tag>destiny</tag>
349         <iteration>0</iteration>
350         <heading>Description Field.Count</heading>
351         <query>SELECT 'Description Field 1', COUNT(*) FROM copies_csv WHERE description_1 IS NOT NULL and description_1 != '' UNION ALL SELECT 'Description Field 2', COUNT(*) FROM copies_csv WHERE description_2 IS NOT NULL and description_2 != '' UNION ALL SELECT 'Description Field 3', COUNT(*) FROM copies_csv WHERE description_3 IS NOT NULL and description_3 != ''</query>
352         <note>Need report?  Retain?</note>
353     </report>
354     
355     <report>
356         <name>destiny_load_fines_byreason</name>
357         <tag>destiny</tag>
358         <iteration>0</iteration>
359         <report_title>Fines by Reason</report_title>
360         <heading>Count.Reason</heading>
361         <query>SELECT COUNT(*), reason FROM fines_csv GROUP BY 2 ORDER BY 2</query>
362     </report>
363
364 <!-- apollo -->
365
366
367     <report>
368         <name>circ_bystatus</name>
369         <report_title>Circulations by Status</report_title>
370         <tag>apollo</tag>
371         <iteration>0</iteration>
372         <heading>Count.Status.Type</heading>
373         <query>SELECT COUNT(id), l_status, l_type FROM action_circulation_legacy GROUP BY 2, 3</query>
374         <note>Circulations will only not be migrated if they can't be attached to a migrated patron and holding.</note>
375     </report>
376
377     <report>
378         <name>hold_bystatus</name>
379         <report_title>Holds by Status</report_title>
380         <tag>apollo</tag>
381         <iteration>0</iteration>
382         <heading>Count.Status</heading>
383         <query> SELECT COUNT(id), l_status FROM action_hold_request_legacy GROUP BY 2</query>
384         <note>Only unfilled holds are being migrated.</note>
385     </report>
386
387     <report>
388         <name>asset_pending_bibs</name>
389         <report_title>Pending Records</report_title>
390         <tag>apollo</tag>
391         <iteration>0</iteration>
392         <heading>Count.Year of Last Edit.Count of Copies Attached</heading>
393         <query>SELECT COUNT(bre.id), CASE WHEN LENGTH(bre.l_edited) > 1 THEN EXTRACT(YEAR FROM bre.l_edited::TIMESTAMP) ELSE '1900' END, COUNT(ac.id) FROM biblio_record_entry_legacy bre LEFT JOIN asset_copy_legacy ac ON ac.l_biblio = bre.l_id WHERE bre.l_status = 'pending' GROUP BY 2 ORDER BY 2
394 </query>
395     </report>
396
397     <report>
398         <name>asset_copies_by_status</name>
399         <report_title>Copies by Status</report_title>
400         <tag>apollo</tag>
401         <iteration>0</iteration>
402         <heading>Count.Status</heading>
403         <query>SELECT COUNT(id), l_status FROM asset_copy_legacy GROUP BY 2 ORDER BY 2</query>
404         <note>Deleted copies with a delete date were not exported additionally those with the deleted status won't get loaded.</note>
405     </report>
406
407     <report>
408         <name>asset_pending_copies</name>
409         <report_title>Pending Copies by Last Edit</report_title>
410         <tag>apollo</tag>
411         <iteration>0</iteration>
412         <heading>Count.Last Edited</heading>
413         <query>SELECT COUNT(id), CASE WHEN LENGTH(l_edited) > 1 THEN EXTRACT(YEAR FROM l_edited::TIMESTAMP) ELSE '1900' END FROM asset_copy_legacy WHERE l_status = 'pending' GROUP BY 2 ORDER BY 2</query>
414     </report>
415
416     <report>
417         <name>assets_by_memberships</name>
418         <report_title>Copies by Memberships</report_title>
419         <tag>apollo</tag>
420         <iteration>0</iteration>
421         <heading>Count.Membership Number.Membership Name</heading>
422         <query>SELECT COUNT(ac.id), acl.l_membership_number, acl.l_membership_name FROM asset_copy_legacy ac JOIN asset_copy_location_legacy acl ON acl.l_membership_name = ac.l_memberships GROUP BY 2,3 ORDER BY 2
423 </query>
424     </report>
425
426    <report>
427         <name>money_bills</name>
428         <report_title>Bills</report_title>
429         <tag>apollo</tag>
430         <iteration>0</iteration>
431         <heading>Count.Status</heading>
432         <query>SELECT COUNT(id), l_status FROM money_billing_legacy GROUP BY 2 ORDER BY 2</query>
433         <note>Unless there is a good reason to do so forgiven and paid bills will not be migrated.</note>
434     </report>
435
436    <report>
437         <name>actor_groups</name>
438         <report_title>Patron Membership Groups</report_title>
439         <tag>apollo</tag>
440         <iteration>0</iteration>
441         <heading>Membership List Name.Membership List ID.Membership Number.Membership Name.Membership Length in Monthst</heading>
442         <query>SELECT l_membership_list_name, l_membership_list_id, l_membership_number, l_membership_name, l_membership_length_months FROM actor_usr_legacy_groups_tsv ORDER BY 1, 3</query>
443         <note>Age looks like a good target for a stat cat and / or juvenile setting while the patron type can map to profiles.</note>
444     </report>
445
446     <report>
447         <name>actor_by_groups</name>
448         <report_title>Patrons by Membership Groups</report_title>
449         <tag>apollo</tag>
450         <iteration>0</iteration>
451         <heading>Count.Membership List Name.Membership Number</heading>
452         <query>SELECT COUNT(*), l_membership_list_name, l_membership_number FROM (SELECT id, UNNEST(STRING_TO_ARRAY(l_memberships,'|')) AS m FROM actor_usr_legacy ) x JOIN actor_usr_legacy_groups_tsv t ON t.l_membership_name = x.m GROUP BY 2, 3 ORDER BY 2, 3</query>
453     </report>
454
455     <report>
456         <name>actor_addresses_nulls</name>
457         <report_title>Patron Addresses</report_title>
458         <tag>apollo</tag>
459         <iteration>0</iteration>
460         <heading>Address Field.Nulls</heading>
461         <query>SELECT 'Street Address', COUNT(id) FROM actor_usr_address_legacy WHERE l_lines IS NULL UNION ALL SELECT 'City', COUNT(id) FROM actor_usr_address_legacy UNION ALL SELECT 'State', COUNT(id) FROM actor_usr_address_legacy WHERE l_country_division IS NULL UNION ALL SELECT 'Postal Code', COUNT(id) FROM actor_usr_address_legacy WHERE l_postal_code IS NULL </query>
462         <note>If any of these fields are null then we need defaults to fill in, note the extract had no city data.</note>
463     </report>
464
465     <report>
466         <name>actor_phones</name>
467         <report_title>Patron Phones</report_title>
468         <tag>apollo</tag>
469         <iteration>0</iteration>
470         <heading>Count.Type</heading>
471         <query>SELECT COUNT(*), l_type FROM actor_usr_phones_tsv GROUP BY 2 ORDER BY 2</query>
472         <note>These need to be mapped to Evergreen phone types.</note>
473     </report>
474
475     <report>
476         <name>hz_borrowersbybtypes</name>
477         <report_title>Borrowers by Borrower Types</report_title>
478         <tag>horizon</tag>
479         <iteration>0</iteration>
480         <heading>Count.Borrower Type</heading>
481         <query>SELECT COUNT(id), l_borrower_btype FROM actor_usr_legacy GROUP BY 2 ORDER BY 2;</query>
482     </report>
483
484     <report>
485         <name>hz_borrowerpinsamples</name>
486         <report_title>Borrower PINs Samples</report_title>
487         <tag>horizon</tag>
488         <iteration>0</iteration>
489         <heading>Sample PINs</heading>
490         <query>SELECT l_borrower_pin FROM actor_usr_legacy WHERE LENGTH(l_borrower_pin) > 1 LIMIT 20;</query>
491         <note>Only 16 PINS defined.</note>
492     </report>
493     
494     <report>
495         <name>hz_borrowernotesample</name>
496         <report_title>Borrower Note Field Samples</report_title>
497         <tag>horizon</tag>
498         <iteration>0</iteration>
499         <heading>Count</heading>
500         <query>SELECT l_borrower_borrower_note FROM actor_usr_legacy WHERE LENGTH(l_borrower_borrower_note) > 1 LIMIT 20;</query>
501         <note>19,473</note>
502     </report>
503
504     <report>
505         <name>hz_borrowernotesample2</name>
506         <report_title>Borrower Note Field 2 Samples</report_title>
507         <tag>horizon</tag>
508         <iteration>0</iteration>
509         <heading>Count</heading>
510         <query>SELECT l_borrower_note2 FROM actor_usr_legacy WHERE LENGTH(l_borrower_note2) > 1 LIMIT 20;</query>
511         <note>78</note>
512     </report>
513
514     <report>
515         <name>hz_borrowernotesample3</name>
516         <report_title>Borrower Note Field 3 Samples</report_title>
517         <tag>horizon</tag>
518         <iteration>0</iteration>
519         <heading>Count</heading>
520         <query>SELECT l_borrower_note3 FROM actor_usr_legacy WHERE LENGTH(l_borrower_note3) > 1 LIMIT 20;</query>
521         <note>Only 6.</note>
522     </report>
523
524     <report>
525         <name>hz_phones</name>
526         <report_title>Borrower Phones</report_title>
527         <tag>horizon</tag>
528         <iteration>0</iteration>
529         <heading>Count.Borrower Phone Type</heading>
530         <query>
531         SELECT COUNT(*), b 
532         FROM (SELECT l_borrower_phone_1_phone_type AS b FROM actor_usr_legacy
533         UNION ALL SELECT l_borrower_phone_2_phone_type AS b FROM actor_usr_legacy
534         UNION ALL SELECT l_borrower_phone_3_phone_type AS b FROM actor_usr_legacy
535         UNION ALL SELECT l_borrower_phone_4_phone_type AS b FROM actor_usr_legacy) x 
536         GROUP BY 2 ORDER BY 2
537         </query>
538         <note>Ordinal phones will have to be combined.</note>
539     </report>
540
541     <report>
542         <name>hz_bstats</name>
543         <report_title>Borrower B-Stats</report_title>
544         <tag>horizon</tag>
545         <iteration>0</iteration>
546         <heading>Count.BStat</heading>
547         <query>SELECT COUNT(*), b 
548         FROM (SELECT l_borrower_bstat_1_bstat AS b FROM actor_usr_legacy
549         UNION ALL
550         SELECT l_borrower_bstat_2_bstat AS b FROM actor_usr_legacy
551         UNION ALL
552         SELECT l_borrower_bstat_3_bstat AS b FROM actor_usr_legacy) x
553         GROUP BY 2 ORDER BY 1;
554         </query>
555     </report>
556     
557     <report>
558         <name>hz_copybycollection</name>
559         <report_title>Copies by Collection</report_title>
560         <tag>horizon</tag>
561         <iteration>0</iteration>
562         <heading>Count.Collection</heading>
563         <query>SELECT COUNT(id), l_collection FROM asset_copy_legacy GROUP BY 2 ORDER BY 2;</query>
564     </report>
565     
566     <report>
567         <name>hz_copyfieldexamples</name>
568         <report_title>Sample Copy Field Values</report_title>
569         <tag>horizon</tag>
570         <iteration>0</iteration>
571         <heading>Field</heading>
572         <query>SELECT l_copy FROM asset_copy_legacy WHERE LENGTH(l_copy) > 1 LIMIT 30;</query>
573     </report>
574
575     <report>
576         <name>hz_itemsbyitype</name>
577         <report_title>Items by IType</report_title>
578         <tag>horizon</tag>
579         <iteration>0</iteration>
580         <heading>Count.Item Type (itype)</heading>
581         <query>SELECT COUNT(id), l_itype FROM asset_copy_legacy GROUP BY 2 ORDER BY 2;</query>
582     </report>
583     
584     <report>
585         <name>hz_volfieldexamples</name>
586         <report_title>Sample Volume Field Values</report_title>
587         <tag>horizon</tag>
588         <iteration>0</iteration>
589         <heading>Field</heading>
590         <query>SELECT l_volume FROM asset_copy_legacy WHERE LENGTH(l_volume) > 1 LIMIT 30;</query>
591         <note></note>
592     </report>
593     
594      <report>
595         <name>hz_iteminhouseuses</name>
596         <report_title>Item In House Uses</report_title>
597         <tag>horizon</tag>
598         <iteration>0</iteration>
599         <heading>Count.Number of Uses</heading>
600         <query>SELECT COUNT(id), l_n_inhouse_uses FROM asset_copy_legacy GROUP BY 2 ORDER BY 2;</query>
601     </report>
602     
603     <report>
604         <name>hz_internalnotesample</name>
605         <report_title>Internal Item Notes</report_title>
606         <tag>horizon</tag>
607         <iteration>0</iteration>
608         <heading>Sample Note</heading>
609         <query>SELECT l_internal_note FROM asset_copy_legacy WHERE LENGTH(l_internal_note) > 1 LIMIT 30;</query>
610     </report>
611     
612 <!-- resource mate -->
613
614     <report>
615         <name>rm_load_circ_count</name>
616         <tag>rm</tag>
617         <iteration>0</iteration>
618         <report_title>Circs by Status</report_title>
619         <heading>Count of Circs.Status</heading>
620         <query>SELECT COUNT(id), l_is_checked_out FROM asset_copy_legacy GROUP BY 2</query>
621     </report>
622
623    <report>
624         <name>rm_load_asset_by_resource_type</name>
625         <report_title>Resource Type</report_title>
626         <tag>rm</tag>
627         <iteration>0</iteration>
628         <heading>Count.Resource Type</heading>
629         <query>SELECT COUNT(*), l_resource_type FROM asset_copy_legacy GROUP BY 2 ORDER BY 2</query>
630     </report>
631
632    <report>
633         <name>rm_load_asset_by_location</name>
634         <report_title>Copies by Location</report_title>
635         <tag>rm</tag>
636         <iteration>0</iteration>
637         <heading>Count.Location</heading>
638         <query>SELECT COUNT(*), l_location FROM asset_copy_legacy GROUP BY 2 ORDER BY 2</query>
639     </report>
640
641     <report>
642         <name>rm_load_asset_by_category</name>
643         <report_title>Copies by Category</report_title>
644         <tag>rm</tag>
645         <iteration>0</iteration>
646         <heading>Count.Category</heading>
647         <query>SELECT COUNT(*), l_category FROM asset_copy_legacy GROUP BY 2 ORDER BY 2</query>
648     </report>
649    
650     <report>
651         <name>rm_load_asset_by_status</name>
652         <report_title>Copies by Status</report_title>
653         <tag>rm</tag>
654         <iteration>0</iteration>
655         <heading>Count.Status</heading>
656         <query>SELECT COUNT(*), l_status FROM asset_copy_legacy GROUP BY 2 ORDER BY 2</query>
657     </report>
658
659     <report>
660         <name>rm_actor_groups</name>
661         <report_title>Patrons by User Groups</report_title>
662         <tag>rm</tag>
663         <iteration>0</iteration>
664         <heading>Count.Group</heading>
665         <query>SELECT COUNT(id), l_user_group FROM actor_usr_legacy GROUP BY 2 ORDER BY 2;
666         </query>
667     </report>
668
669     <report>
670         <name>rm_actor_access</name>
671         <report_title>Patrons by Access Field</report_title>
672         <tag>rm</tag>
673         <iteration>0</iteration>
674         <heading>Count.Access</heading>
675         <query>SELECT COUNT(id), l_access_if_applicable FROM actor_usr_legacy GROUP BY 2 ORDER BY 2;
676         </query>
677     </report>
678     <report>
679         <name>rm_actor_comments</name>
680         <report_title>Patron Comments</report_title>
681         <tag>rm</tag>
682         <iteration>0</iteration>
683         <heading>Count.Sample</heading>
684         <query>SELECT COUNT(id), 'All Comments' FROM actor_usr_legacy WHERE LENGTH(l_comments) > 1
685             UNION ALL SELECT NULL, l_comments FROM  actor_usr_legacy WHERE LENGTH(l_comments) > 1 LIMIT 10
686         </query>
687     </report>
688
689     <report>
690         <name>rm_actor_circulation_note</name>
691         <report_title>Patron Circ Notes</report_title>
692         <tag>rm</tag>
693         <iteration>0</iteration>
694         <heading>Count.Sample</heading>
695         <query>SELECT COUNT(id), 'All Notes' FROM actor_usr_legacy WHERE LENGTH(l_circulation_note) > 1
696             UNION ALL SELECT NULL, l_circulation_note FROM  actor_usr_legacy WHERE LENGTH(l_circulation_note) > 1 LIMIT 10
697         </query>
698     </report>
699
700 <!-- tlc reports 
701
702     <report>
703         <name>tlc_reports_load_asset_holdings_codes</name>
704         <report_title>Holdings Codes</report_title>
705         <tag>tlc_reports</tag>
706         <iteration>0</iteration>
707         <heading>Count.Library.Holdings Codes.Evergreen Circulation Modifier.Evergreen Shelving Locatione</heading>
708         <query>SELECT COUNT(id), x_source, l_holdingscode FROM asset_copy_legacy GROUP BY 2, 3 ORDER BY 2, 3</query>
709     </report>
710
711     <report>
712         <name>tlc_reports_load_usrs_bygroup</name>
713         <report_title>Patrons by Agency Type</report_title>
714         <tag>tlc_reports</tag>
715         <iteration>0</iteration>
716         <heading>Count.Library.Permission Group.Evergreen Permission Group</heading>
717         <query>SELECT COUNT(id), l_location, l_borrower_type FROM actor_usr_legacy GROUP BY 2, 3 ORDER BY 2, 3</query>
718     </report>
719
720     <report>
721         <name>tlc_reports_load_usr_balance</name>
722         <report_title>Count and Sum of Balances</report_title>
723         <tag>tlc_reports</tag>
724         <iteration>0</iteration>
725         <heading>Count.SUM.Migrate?</heading>
726         <query>SELECT COUNT(id), SUM(l_current_fine_balance::NUMERIC(6,2)) FROM actor_usr_address_legacy WHERE l_current_fine_balance != '0' AND l_current_fine_balance IS NOT NULL</query>
727     </report>
728
729     <report>
730         <name>tlc_reports_users_blocked</name>
731         <report_title>Count of Blocked Patrons</report_title>
732         <tag>tlc_reports</tag>
733         <iteration>0</iteration>
734         <heading>Count.Blocked.Migrate?</heading>
735         <query>SELECT COUNT(id), l_blocked FROM actor_usr_address_legacy GROUP BY 2</query>
736     </report>
737
738     <report>
739         <name>tlc_reports_load_usr_addresses_phones</name>
740         <report_title>Patron Phones</report_title>
741         <tag>tlc_reports</tag>
742         <iteration>0</iteration>
743         <heading>Count.Phone Type.Phone Type</heading>
744         <query>SELECT COUNT(id), 'Phone 1' FROM actor_usr_address_legacy WHERE l_phone_1 IS NOT NULL GROUP BY 2 UNION ALL SELECT COUNT(id), 'Phone 2' FROM actor_usr_address_legacy WHERE l_phone_2 IS NOT NULL GROUP BY 2</query>
745     </report>
746 -->
747 </reports_file>