Statistik
Statistik i Koha finns under menyvalet "Mer / Rapporter" och redan från början finns ett antal färdiga rapporter som kan köras genom att klicka på länkarna. Den som vill kan också skapa egen statistik med hjälp av ett grafiskt gränssnitt även om det kräver viss förståelse av hur informationen är strukturerad i databasen. För den som kan databasspråket SQL finns det mycket goda möjligheter att ta ut egen statistik via SQL-frågor.
Egna SQL-rapporter kan du göra publika och de visas då som JSON-data vilket gör dem mycket användbara för att t.ex. förse en egen widget i Opac med rådata. Motsvarande skall också att göra med widgets i personalgränssnittet utan att känslig data exponeras publikt. I normalfallet tittar du på rapporten direkt i Koha och kan därifrån också ladda ned datat till Excel m.fl. för vidare bearbetning.
SQL-rapporter som andra funnit användbara
'Författarfonden: Statistik/Författarfonden
De här rapporterna togs ursprungligen fram av Magnus Enger för Hyltes räkning. Notera att de är avsedda som en utgångspunkt för dina egna rapporter - du kommer troligen behöva anpassa dem något. Rapporterna finns också tillgängliga på det internationella Koha communityts wiki. [1]
Några råd om hur du anpassar rapporterna:
- Databasens struktur ser likadan ut i olika Koha-installationer, men däremot ändras koderna för medietyper, biblioteksfilialer och placeringar. Dessa behöver du ändra för att matcha de ditt bibliotek använder. Koder för medietyp hittar du på http://www.minkoha-personaldel.se/cgi-bin/koha/admin/itemtypes.pl. Koder för biblioteken hittar du på /cgi-bin/koha/admin/branches.pl och placeringarna finns på /cgi-bin/koha/admin/authorised_values.pl under LOC i drop-down menyn.
- Referenser till datum behöver du ändra så de stämmer med den tidpunkt du vill ta ut statistik för.
Ref, antal exemplar och signum
SELECT i.homebranch AS Bibliotek, SUBSTRING_INDEX( b.author, ', ', 1 ) AS Frfnamn, b.title AS Titel, SUBSTRING_INDEX( b.author, ', ', -1 ) AS Frffnamn, volume AS Del, editionstatement AS Upplaga, publicationyear AS Utgar, isbn AS Isbn, itemcallnumber AS signum, COUNT(*) AS Antal FROM items as i, biblio as b, biblioitems as bi WHERE i.biblionumber = b.biblionumber AND i.biblionumber = bi.biblionumber AND i.notforloan = 1 GROUP BY i.biblionumber
Ref och antal exemplar
SELECT i.homebranch AS Bibliotek, SUBSTRING_INDEX( b.author, ', ', 1 ) AS Frfnamn, b.title AS Titel, SUBSTRING_INDEX( b.author, ', ', -1 ) AS Frffnamn, volume AS Del, editionstatement AS Upplaga, publicationyear AS Utgar, isbn AS Isbn, COUNT(*) AS Antal FROM items as i, biblio as b, biblioitems as bi WHERE i.biblionumber = b.biblionumber AND i.biblionumber = bi.biblionumber AND i.notforloan = 1 GROUP BY i.biblionumber
År 2014 – Ej referens, antal utlån
Ändra raden "AND s.datetime like '2016-&'" till det år du vill ta ut statistik för. Ändra också tredje raden från slutet "AND (i.itype = "A"..." för att spegla de medietyper du vill inkludera i utlåningsstatistiken. Eller ändra till AND i.itype != "REF" om du du bara vill utesluta referens (med koden "REF"). Du hittar dina egna koder för medietyper på http://www.minkoha-personaldel.se/cgi-bin/koha/admin/itemtypes.pl
SELECT s.branch AS Bibliotek, SUBSTRING_INDEX( b.author, ', ', 1 ) AS Frfnamn, b.title AS Titel, SUBSTRING_INDEX( b.author, ', ', -1 ) AS Frffnamn, volume AS Del, editionstatement AS Upplaga, publicationyear AS Utgar, isbn AS Isbn, COUNT(*) AS Antal FROM statistics as s, items as i, biblio as b, biblioitems as bi WHERE s.itemnumber = i.itemnumber AND i.biblionumber = b.biblionumber AND i.biblionumber = bi.biblionumber AND s.datetime like '2016-%' AND s.type = 'issue' AND ( i.itype = 'A' OR i.itype = 'DEP' OR i.itype = 'B' OR i.itype = 'C' OR i.itype = 'TIDN' ) AND i.notforloan = 0 GROUP BY i.biblionumber
KB-statistiken
Dessa rapporter togs ursprungligen fram av Magnus Enger på uppdrag av Hylte folkbibliotek. För att använda dem behöver du anpassa dem med avseende på sådant som t.ex. datum och de bibliotekskoder, koder för medietyp m.fl. som du använder.
19 Streckkoder referensexemplar Visar alla streckkoder för referensböcker. Antalet visas av Koha som anger antal matchande rader.
SELECT barcode FROM items WHERE notforloan = 1
11-5 Antal referensexemplar
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE notforloan = 1 AND dateaccessioned NOT LIKE '2015-%' GROUP BY homebranch
18 Skönlitteratur - Bestånd för vuxna - lista
SELECT itemcallnumber, count(*) AS Antal FROM items WHERE itemcallnumber NOT LIKE '% %' -- Må ikke innehole mellomrom AND BINARY itemcallnumber LIKE '%H%' -- Må inneholde en stor H AND itemcallnumber != 'Hcg' -- Må ikke være Hcg AND itemcallnumber != 'Hcf' -- Må ikke være HCF AND BINARY itemcallnumber NOT LIKE 'u%' -- Må ikke starte på liten u AND BINARY itemcallnumber NOT LIKE 'uf%' -- Må ikke starte på liten uf AND BINARY itemcallnumber NOT LIKE 'ug%' -- Må ikke starte på liten ug GROUP BY itemcallnumber
18 Skönlitteratur - Bestånd för vuxna
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE itemcallnumber NOT LIKE '% %' AND BINARY itemcallnumber LIKE '%H%' AND itemcallnumber != 'Hcg' AND itemcallnumber != 'Hcf' AND BINARY itemcallnumber NOT LIKE 'u%' AND BINARY itemcallnumber NOT LIKE 'uf%' AND BINARY itemcallnumber NOT LIKE 'ug%' AND dateaccessioned NOT LIKE '2014-%' GROUP BY homebranch
18 Skönlitteratur - Bestånd för barn - lista
SELECT itemcallnumber, COUNT(*) AS Antal FROM items WHERE itemcallnumber NOT LIKE '% %' AND ( BINARY itemcallnumber LIKE 'uH%' OR BINARY itemcallnumber LIKE 'ufH%' OR BINARY itemcallnumber LIKE 'ugH%' OR BINARY itemcallnumber LIKE 'Hcg%' OR BINARY itemcallnumber LIKE 'Hcf%' ) GROUP BY itemcallnumber
18 Skönlitteratur - Bestånd för barn
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE itemcallnumber NOT LIKE '% %' AND ( BINARY itemcallnumber LIKE 'uH%' OR BINARY itemcallnumber LIKE 'ufH%' OR BINARY itemcallnumber LIKE 'ugH%' OR BINARY itemcallnumber LIKE 'Hcg%' OR BINARY itemcallnumber LIKE 'Hcf%' ) AND dateaccessioned NOT LIKE '2014-%' GROUP BY home branch
18 Skönlitteratur - Nyförvärv för vuxna
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE dateaccessioned LIKE '2013-%' AND ( itemcallnumber NOT LIKE '% %' AND BINARY itemcallnumber LIKE '%H%' AND itemcallnumber != 'Hcg' AND itemcallnumber != 'Hcf' AND BINARY itemcallnumber NOT LIKE 'u%' AND BINARY itemcallnumber NOT LIKE 'uf%' AND BINARY itemcallnumber NOT LIKE 'ug%' ) GROUP BY home branch
18 Skönlitteratur - Nyförvärv för barn
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE dateaccessioned LIKE '2013-%' AND ( itemcallnumber NOT LIKE '% %' AND ( BINARY itemcallnumber LIKE 'uH%' OR BINARY itemcallnumber LIKE 'ufH%' OR BINARY itemcallnumber LIKE 'ugH%' OR BINARY itemcallnumber LIKE 'Hcg%' OR BINARY itemcallnumber LIKE 'Hcf%' ) ) GROUP BY home branch
18 Fack- och referenslitteratur - Bestånd för vuxna - lista
SELECT itemcallnumber, COUNT(*) AS Antal FROM items WHERE BINARY itemcallnumber NOT LIKE '%H%' AND BINARY itemcallnumber NOT LIKE 'u%' AND BINARY itemcallnumber NOT LIKE 'uf%' AND BINARY itemcallnumber NOT LIKE 'ug%' GROUP BY itemcallnumber
18 Fack- och referenslitteratur - Bestånd för vuxna
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE BINARY itemcallnumber NOT LIKE '%H%' AND BINARY itemcallnumber NOT LIKE 'u%' AND BINARY itemcallnumber NOT LIKE 'uf%' AND BINARY itemcallnumber NOT LIKE 'ug%' AND dateaccessioned NOT LIKE '2014-%' GROUP BY home branch
18 Fack- och referenslitteratur - Bestånd för barn - lista
SELECT itemcallnumber, COUNT(*) AS Antal FROM items WHERE BINARY itemcallnumber NOT LIKE '%H%' AND ( BINARY itemcallnumber LIKE 'u%' OR BINARY itemcallnumber LIKE 'uf%' OR BINARY itemcallnumber LIKE 'ug%' ) GROUP BY itemcallnumber
18 Fack- och referenslitteratur - Bestånd för barn
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE BINARY itemcallnumber NOT LIKE '%H%' AND ( BINARY itemcallnumber LIKE 'u%' OR BINARY itemcallnumber LIKE 'uf%' OR BINARY itemcallnumber LIKE 'ug%' ) AND dateaccessioned NOT LIKE '2014-%' GROUP BY home branch
18 Fack- och referenslitteratur - Nyförvärv för vuxna
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE dateaccessioned LIKE '2013-%' AND ( BINARY itemcallnumber NOT LIKE '%H%' AND BINARY itemcallnumber NOT LIKE 'u%' AND BINARY itemcallnumber NOT LIKE 'uf%' AND BINARY itemcallnumber NOT LIKE 'ug%' ) AND dateaccessioned NOT LIKE '2014-%' GROUP BY homebranch
18 Fack- och referenslitteratur - Nyförvärv för barn
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE dateaccessioned LIKE '2013-%' AND ( BINARY itemcallnumber NOT LIKE '%H%' AND ( BINARY itemcallnumber LIKE 'u%' OR BINARY itemcallnumber LIKE 'uf%' OR BINARY itemcallnumber LIKE 'ug%' ) ) AND dateaccessioned NOT LIKE '2014-%' GROUP BY homebranch
20 nyförvärvade titler - poster (etter migrering)
SELECT COUNT(*) AS Antal FROM biblio WHERE datecreated LIKE '2013-%' AND datecreated != '2013-09-07'
20 nyförvärvade titler - eksemplar (hele året)
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE dateaccessioned LIKE '2013-%' GROUP BY homebranch
21 Bestånd av AV-medier per avdelning
Man må velge hvilken avdeling raporten skal gjelde for.
SELECT itemtype, description, COUNT(*) AS Antal FROM itemtypes AS t, items AS i WHERE t.itemtype = i.itype AND itemtype != 'A' AND itemtype != 'FJ' AND itemtype != 'C' AND itemtype != 'DEP' AND itemtype != 'E' AND itemtype != 'N' AND itemtype != 'H' AND itemtype != 'TIDN' AND homebranch = <> GROUP BY itemtype
21 Nyförvärv av AV-medier
Man må velge hvilken avdeling raporten skal gjelde for.
SELECT itemtype, description, COUNT(*) AS Antal FROM itemtypes AS t, items AS i WHERE t.itemtype = i.itype AND itemtype != 'A' AND itemtype != 'C' AND itemtype != 'DEP' AND itemtype != 'E' AND itemtype != 'N' AND itemtype != 'H' AND itemtype != 'TIDN' AND i.dateaccessioned like '2013-%' AND homebranch = <> GROUP BY itemtype
25 Beståndet av anpassade medier
SELECT homebranch AS Avdelning, COUNT(*) AS Antal FROM items WHERE itype = 'TALBOK' AND dateaccessioned NOT LIKE '2014-%' GROUP BY homebranch 25 Utlåningen av anpassade medier SELECT branch AS Avdelning, COUNT(*) AS Antal FROM statistics WHERE datetime LIKE '2013-%' AND itemtype = 'TALBOK' AND ( type = 'issue' OR type = 'renew' ) GROUP BY branch
27 Utlån - Skönlitteratur för vuxna
SELECT branch AS Avdelning, COUNT(*) AS Antal FROM statistics, items WHERE statistics.itemnumber = items.itemnumber AND datetime like '2013-%' AND ( statistics.type = 'issue' OR statistics.type = 'renew' ) AND items.itemcallnumber NOT LIKE '% %' AND BINARY items.itemcallnumber LIKE '%H%' AND items.itemcallnumber != 'Hcg' AND items.itemcallnumber != 'Hcf' AND BINARY items.itemcallnumber NOT LIKE 'u%' AND BINARY items.itemcallnumber NOT LIKE 'uf%' AND BINARY items.itemcallnumber NOT LIKE 'ug%' GROUP BY branch
27 Utlån - Skönlitteratur för barn
SELECT branch AS Avdelning, COUNT(*) AS Antal FROM statistics, items WHERE statistics.itemnumber = items.itemnumber AND statistics.datetime like '2013-%' AND ( type = 'issue' OR type = 'renew' ) AND items.itemcallnumber NOT LIKE '% %' AND ( BINARY items.itemcallnumber LIKE 'uH%' OR BINARY items.itemcallnumber LIKE 'ufH%' OR BINARY items.itemcallnumber LIKE 'ugH%' OR BINARY items.itemcallnumber LIKE 'Hcg%' OR BINARY items.itemcallnumber LIKE 'Hcf%' ) GROUP BY branch
27 Utlån - Fack- och referenslitteratur för vuxna
SELECT branch AS Avdelning, COUNT(*) AS Antal FROM statistics, items WHERE statistics.itemnumber = items.itemnumber AND statistics.datetime like '2013-%' AND ( statistics.type = 'issue' OR statistics.type = 'renew' ) AND BINARY items.itemcallnumber NOT LIKE '%H%' AND BINARY items.itemcallnumber NOT LIKE 'u%' AND BINARY items.itemcallnumber NOT LIKE 'uf%' AND BINARY items.itemcallnumber NOT LIKE 'ug%' GROUP BY branch
27 Utlån - Fack- och referenslitteratur för barn
SELECT branch AS Avdelning, COUNT(*) AS Antal FROM statistics, items WHERE statistics.itemnumber = items.itemnumber AND statistics.datetime like '2013-%' AND ( statistics.type = 'issue' OR statistics.type = 'renew' ) AND BINARY items.itemcallnumber NOT LIKE '%H%' AND ( BINARY items.itemcallnumber LIKE 'u%' OR BINARY items.itemcallnumber LIKE 'uf%' OR BINARY items.itemcallnumber LIKE 'ug%' ) GROUP BY branch
28 Utlåningen av AV-medier - aktive lån
SELECT items.itype, COUNT(*) AS Laan, SUM(issues.renewals) AS Omlaan FROM issues LEFT JOIN items ON issues.itemnumber = items.itemnumber WHERE itype != 'A' AND itype != 'C' AND itype != 'DEP' AND itype != 'E' AND itype != 'N' AND itype != 'H' AND itype != 'TIDN' GROUP BY itype
28 Utlåningen av AV-medier - gamla lån
SELECT items.itype, COUNT(*) AS Laan, SUM(old_issues.renewals) AS Omlaan FROM old_issues LEFT JOIN items ON old_issues.itemnumber = items.itemnumber WHERE itype != 'A' AND itype != 'C' AND itype != 'DEP' AND itype != 'E' AND itype != 'N' AND itype != 'H' AND itype != 'TIDN' GROUP BY itype
28 Utlån av AV-medier
Må velge hvilken avdeling rapporten gjelder for
SELECT statistics.itemtype AS Typ, itemtypes.description AS Beskrivning, COUNT(*) AS Antal FROM statistics, itemtypes WHERE statistics.itemtype = itemtypes.itemtype AND statistics.itemtype != 'A' AND statistics.itemtype != 'C' AND statistics.itemtype != 'FJ' AND statistics.itemtype != 'DEP' AND statistics.itemtype != 'E' AND statistics.itemtype != 'N' AND statistics.itemtype != 'H' AND statistics.itemtype != 'TIDN' AND datetime like '2013-%' AND branch = <> GROUP BY statistics.itemtype
Utlåningen av talböcker 2014
SELECT branch AS Avdelning, COUNT(*) AS Antal FROM statistics WHERE datetime LIKE '2014-%' AND itemtype = 'TALBOK' AND ( type = 'issue' OR type = 'renew' ) GROUP BY branch
Ut- och omlån 2014.
Allt - fördelat på månader.
SELECT branch AS Avdelning, LEFT(datetime, 7) as Maanad, COUNT(*) AS Antal FROM statistics, items WHERE statistics.itemnumber = items.itemnumber AND datetime like '2014%' AND ( statistics.type = 'issue' OR statistics.type = 'renew' ) AND items.itemcallnumber NOT LIKE '% %' AND branch = <> GROUP BY Maanad
Ut- och omlån 2015.
Allt - fördelat på månader.
SELECT branch AS Avdelning, MONTH(datetime) as "Månad", COUNT(*) AS Antal FROM statistics, items WHERE statistics.itemnumber = items.itemnumber AND datetime like '2015%' AND ( statistics.type = 'issue' OR statistics.type = 'renew' ) -- AND items.itemcallnumber NOT LIKE '% %' AND branch = <> GROUP BY Månad
19d - Totalt antal aktiva låntagare
SELECT COUNT(DISTINCT borrowernumber) AS Antal_aktiva FROM statistics WHERE datetime LIKE '2016-%' AND branch != 'ORN'
19e - Aktiva låntagare som är under 18 år
SELECT COUNT(DISTINCT s.borrowernumber) AS Antal_aktiva FROM statistics AS s, borrowers AS b WHERE s.borrowernumber = b.borrowernumber AND b.dateofbirth > DATE_SUB(CURDATE(), INTERVAL 18 YEAR) AND s.branch != 'ORN' AND s.datetime LIKE '2016%'
19c - Antal aktiva låntagare som är institutionslåntagare eller personer som saknar uppgift om personnummer
SELECT COUNT(DISTINCT s.borrowernumber) AS Antal_aktiva FROM statistics AS s LEFT JOIN borrower_attributes AS ba ON s.borrowernumber = ba.borrowernumber WHERE s.datetime LIKE '2015%' AND s.branch != 'ORN' AND ba.attribute IS NULL
12a - Antal titlar på svenska språket
SELECT SUBSTRING(ExtractValue(marcxml, '//controlfield[@tag="008"]'), 36, 3) AS Språk, count(*) AS Antal FROM biblioitems GROUP BY Språk HAVING Språk = 'swe'
12b - Antal titlar på nationellt minoritetsspråk
SELECT SUBSTRING(ExtractValue(marcxml, '//controlfield[@tag="008"]'), 36, 3) AS Språk, count(*) AS Antal FROM biblioitems GROUP BY Språk HAVING ( Språk = 'fin' OR Språk = 'smi' OR Språk = '9mk' OR Språk = 'rom' OR Språk = 'yid' )
12c - Antal titlar på utländska språk
SELECT COUNT(*) AS Antal FROM biblioitems WHERE SUBSTRING(ExtractValue(marcxml, '//controlfield[@tag="008"]'), 36, 3) != 'swe' AND SUBSTRING(ExtractValue(marcxml, '//controlfield[@tag="008"]'), 36, 3) != 'fin' AND SUBSTRING(ExtractValue(marcxml, '//controlfield[@tag="008"]'), 36, 3) != 'smi' AND SUBSTRING(ExtractValue(marcxml, '//controlfield[@tag="008"]'), 36, 3) != '9mk' AND SUBSTRING(ExtractValue(marcxml, '//controlfield[@tag="008"]'), 36, 3) != 'rom' AND SUBSTRING(ExtractValue(marcxml, '//controlfield[@tag="008"]'), 36, 3) != 'yid'
19a - Antal aktiva låntagare som är kvinnor (Näst sista siffran i personnumret är jämn siffra)
SELECT COUNT(DISTINCT s.borrowernumber) AS Antal FROM statistics AS s, borrower_attributes AS ba WHERE s.borrowernumber = ba.borrowernumber AND s.datetime LIKE '2016-%' AND s.branch != 'ORN' AND code = 'PRNSNR' AND LEFT( RIGHT(attribute, 2), 1) % 2 = 0
19b - Antal aktiva låntagare som är män (Näst sista siffran i personnumret är ojämn siffra)
SELECT COUNT(DISTINCT s.borrowernumber) AS Antal FROM statistics AS s, borrower_attributes AS ba WHERE s.borrowernumber = ba.borrowernumber AND s.datetime LIKE '2016-%' AND s.branch != 'ORN' AND code = 'PRNSNR' AND LEFT( RIGHT(attribute, 2), 1) % 2 = 1
10A: Allting med itemtype: objekttyp böcker - Antal fack / skön / barn / vuxen
SELECT COUNT(*) FROM items WHERE itype = 'BOK' AND homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2015
10A: Allting med itemtype: objekttyp böcker - Nyförvärv fack / skön / barn / vuxen
SELECT COUNT(*) FROM items WHERE itype = 'BOK' AND homebranch != 'ORN' AND YEAR(dateaccessioned) = 2015
10B: Ljudböcker - Antal objekt
SELECT COUNT(*) FROM items WHERE itype = 'LJUDBOK' AND homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2015
10B: Ljudböcker - Nyförvärv
SELECT COUNT(*) FROM items WHERE itype = 'LJUDBOK' AND homebranch != 'ORN' AND YEAR(dateaccessioned) = 2015
10C: Talböcker / Daisy - Antal objekt
SELECT COUNT(*) FROM items WHERE itype = 'TALBOK' AND homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2015
10C: Talböcker / Daisy - Nyförvärv
SELECT COUNT(*) FROM items WHERE itype = 'TALBOK' AND homebranch != 'ORN' AND YEAR(dateaccessioned) = 2015
10D: itemtype Tidningar & Tidskrifter - Antal objekt
SELECT COUNT(*) FROM items WHERE itype = 'TIDNINGAR' AND homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2015
10D: itemtype Tidningar & Tidskrifter - Nyförvärv
SELECT COUNT(*) FROM items WHERE itype = 'TIDNINGAR' AND homebranch != 'ORN' AND YEAR(dateaccessioned) = 2015
10F: Musik cd - Antal objekt
SELECT COUNT(*) FROM items WHERE itype = 'MUSIK' AND homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2015
10F: Musik cd - Nyförvärv
SELECT COUNT(*) FROM items WHERE itype = 'MUSIK' AND homebranch != 'ORN' AND YEAR(dateaccessioned) = 2015
10H: mikrofilm mm - Antal objekt
SELECT COUNT(*) FROM items WHERE itype = 'MIKROFILME' AND homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2015
10H: mikrofilm mm - Nyförvärv
SELECT COUNT(*) FROM items WHERE itype = 'MIKROFILME' AND homebranch != 'ORN' AND YEAR(dateaccessioned) = 2015
10I: Kartor mm - Antal objekt
SELECT COUNT(*) FROM items WHERE itype = 'KARTOR' AND homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2015
10I: Kartor mm - Nyförvärv
SELECT COUNT(*) FROM items WHERE itype = 'KARTOR' AND homebranch != 'ORN' AND YEAR(dateaccessioned) = 2015
10J: Noter mm - Antal objekt
SELECT COUNT(*) FROM items WHERE itype = 'NOTER' AND homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2015
10J: Noter mm - Nyförvärv
SELECT COUNT(*) FROM items WHERE itype = 'NOTER' AND homebranch != 'ORN' AND YEAR(dateaccessioned) = 2015
10G: Film - Antal objekt (allt med itemtype: Hyr-DVD och Musik-DVD)
SELECT COUNT(*) FROM items WHERE ( itype = 'HYRDVD' OR itype = 'MUSIKFILM' ) AND homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2015
10G: Film - Nyförvärv (allt med itemtype: Hyr-DVD och Musik-DVD)
SELECT COUNT(*) FROM items WHERE ( itype = 'HYRDVD' OR itype = 'MUSIKFILM' ) AND homebranch != 'ORN' AND YEAR(dateaccessioned) = 2015
10 Objekttyper - Antal objekter
Alle bibliotek, unntatt Örnaskolan.
SELECT itype, COUNT(*) AS Antal FROM items WHERE homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2016 GROUP BY itype
10 Objekttyper - Nyförvärv
Alle bibliotek, unntatt Örnaskolan.
SELECT itype, COUNT(*) AS Antal FROM items WHERE homebranch != 'ORN' AND YEAR(dateaccessioned) = 2016 GROUP BY itype <pre> 14 - Initiala lån Alle bibliotek <pre> SELECT s.itemtype, i.description, COUNT(*) AS Initiala FROM statistics AS s, itemtypes as i WHERE s.itemtype = i.itemtype AND s.type = 'issue' AND YEAR(s.datetime) = 2014 GROUP BY s.itemtype
14 - Omlån
Alle bibliotek
SELECT s.itemtype, i.description, COUNT(*) AS Initiala FROM statistics AS s, itemtypes as i WHERE s.itemtype = i.itemtype AND s.type = 'renew' AND YEAR(s.datetime) = 2014 GROUP BY s.itemtype
14 - Totala utlån
Alle bibliotek, unntatt Örnaskolan
SELECT s.itemtype, i.description, COUNT(*) AS Initiala FROM statistics AS s, itemtypes as i WHERE s.itemtype = i.itemtype AND ( s.type = 'issue' OR s.type = 'renew' ) AND YEAR(s.datetime) = 2015 GROUP BY s.itemtype
11-1 Bestånd av tryckta böcker och seriella publikationer för barn & unga
Alle bibliotek, unntatt Örnaskolan.
SELECT itype, COUNT(*) AS Antal FROM items WHERE homebranch != 'ORN' AND YEAR(dateaccessioned) <= 2016 AND BINARY itemcallnumber LIKE 'u%' AND homebranch != 'ORN' GROUP BY itype
11-2 Antal nyförvärv av tryckta böcker och seriella publikationer för barn & unga
Alle bibliotek, unntatt Örnaskolan.
SELECT itype, COUNT(*) AS Antal FROM items WHERE homebranch != 'ORN' AND YEAR(dateaccessioned) = 2016 AND BINARY itemcallnumber LIKE 'u%' AND homebranch != 'ORN' GROUP BY itype
11-3: Antal utlån av tryckta böcker och seriella publikationer för barn & unga
Alle bibliotek, unntatt Örnaskolan
SELECT s.itemtype, i.description, COUNT(*) AS Initiala FROM statistics AS s, itemtypes as i, items WHERE s.itemtype = i.itemtype AND s.itemnumber = items.itemnumber AND ( s.type = 'issue' OR s.type = 'renew' ) AND s.branch != 'ORN' AND YEAR(s.datetime) = 2016 AND BINARY items.itemcallnumber LIKE 'u%' GROUP BY s.itemtype
11-4: Bestånd av skönlitteratur, tryckta böcker eller seriella publikationer
SELECT itype AS itemtype, COUNT(*) AS Antal FROM items WHERE ( BINARY LEFT(itemcallnumber,4) LIKE '%H%' OR itemcallnumber LIKE '8%' ) AND YEAR(dateaccessioned) <= 2015 AND homebranch != 'ORN' GROUP BY itype
11-6: Bestånd av medier för personer med läsnedsättning
Alle bibliotek unntatt Örnaskolan
SELECT itype AS itemtype, COUNT(*) AS Antal FROM items WHERE ( location = 'TALBOKVUXEN' OR location = 'TALBOKBARN' OR location = 'TALBOKTUNN' OR location = 'APPELHYLLAN' OR location = 'BOKDAISY' OR location = 'SPRAKKEDJAN' OR location = 'SPRAKVASKOR' OR location = 'LATTLAST' OR location = 'LLMP3' OR location = 'LLSVE' OR location = 'STORSTIL' ) AND YEAR(dateaccessioned) <= 2015 AND homebranch != 'ORN' GROUP BY itype
11-7: Utlån av medier för personer med läsnedsätting
Alle bibliotek unntatt Örnaskolan
SELECT i.itype AS itemtype, COUNT(*) AS Antal FROM statistics AS s, items AS i WHERE s.itemnumber = i.itemnumber AND ( location = 'TALBOKVUXEN' OR location = 'TALBOKBARN' OR location = 'TALBOKTUNN' OR location = 'APPELHYLLAN' OR location = 'BOKDAISY' OR location = 'SPRAKKEDJAN' OR location = 'SPRAKVASKOR' OR location = 'LATTLAST' OR location = 'LLMP3' OR location = 'LLSVE' OR location = 'STORSTIL' ) AND s.branch != 'ORN' AND s.type = 'issue' GROUP BY itype
Bibliotek Mellansjös statistikrapporter för 2018
Lånestatistik Bibliotek Mellansjö
Bibliotek Mellansjös gallringslista
Gallringslista Bibliotek Mellansjö
Stockholms universitetsbibliotek statistikrapporter
Stockholms_universitetsbibliotek
Musik- och teaterbibliotekets statistikrapporter
Användbara sätt att länka
Länkar till katalogposter
Länk till katalogpost
CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',biblio.biblionumber,'\" target="_blank">', biblio.title, '</a>' )
Redigera katalogpost
CONCAT('<a href=\"/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=', biblionumber, '\">', biblionumber, '</a>' )
Redigera katalogpost, öppna flik 9
CONCAT('<a href=\"/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=', biblio_metadata.biblionumber, '#tab9XX', '\" target="_blank">',biblio_metadata.biblionumber, '</a>' )
Redigera katalogpost, spara med bibliografiskt ramverk VR
CONCAT('<a href=\"/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=', biblioitems.biblionumber, '&frameworkcode=VR', '\" target="_blank">',biblioitems.biblionumber, '</a>' )
Länkar till exemplarposter
Länk till exemplarpost
Status med mera för exemplar
CONCAT('<a href=\"/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=', items.itemnumber, '&biblionumber=',biblio.biblionumber,'\" target="_blank">', items.barcode, '</a>' )
Flytta exemplar till katalogpost 309518
CONCAT('<a href=\"/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=309518&&barcode=', items.barcode, '\" target="_blank">flytta</a>' )
Länkar till låntagarposter
Länk till låntagarpost
CONCAT('<a href=\"/cgi-bin/koha/members/moremember.pl?borrowernumber=', borrowers.borrowernumber,'\" target="_blank">', borrowers.cardnumber, '</a>' )
Länk till utlåningssidan för en låntagare
CONCAT('<a href=\"/cgi-bin/koha/circ/circulation.pl?borrowernumber=',borrowernumber,'\" target="_blank">', borrowernumber, '</a>')
Länk till en låntagares skickade meddelanden
CONCAT('<a href=\"/cgi-bin/koha/members/notices.pl?borrowernumber=', borrowernumber, '\" target="_blank">', borrowernumber, '</a>' )
Länk till en låntagares avgifter
CONCAT('<a href=\"/cgi-bin/koha/members/boraccount.pl?borrowernumber=',borrowernumber,'\">', borrowernumber, '</a>')
Länk till en låntagares lånehistorik
CONCAT('<a href=\"/cgi-bin/koha/members/deletemem.pl?member=',borrowers.borrowernumber,'\" target="_blank">Radera</a>' )
Betala förseningsavgift
CONCAT('<a href=\"/cgi-bin/koha/members/pay.pl?borrowernumber=',borrowers.borrowernumber,'\" target="_blank">Betala</a>' )
Avskriv förseningsavgift
CONCAT('<a href=\"/cgi-bin/koha/members/paycollect.pl?borrowernumber=', accountlines.borrowernumber, '&writeoff_individual=1&accounttype=',accountlines.accounttype, '&amount=',accountlines.amount, '&amountoutstanding=',accountlines.amountoutstanding, '&accountlines_id=',accountlines.accountlines_id,'\" target="_blank">', FLOOR(accountlines.amountoutstanding), '</a>' )
Länk till låntagarpost, fliken begränsningar
CONCAT('<a href=\"/cgi-bin/koha/members/moremember.pl?borrowernumber=', borrowers.borrowernumber, '#reldebarments','\" target="_blank">', borrowers.cardnumber, '</a>' )
Radera låntagare
CONCAT('<a href=\"/cgi-bin/koha/members/deletemem.pl?member=',borrowers.borrowernumber,'\" target="_blank">Radera</a>' )
Länkar till reservationer
Pausa/återuppta reservation
Varannat klick pausas reservationen, varannat klick återupptas den CONCAT('<a href=\"/cgi-bin/koha/reserve/request.pl?action=toggleSuspend&reserve_id=', reserve_id, '&borrowernumber=', reserves.borrowernumber, '&biblionumber=', reserves.biblionumber, '\" target="_blank">', reserves.borrowernumber, '</a>' )
Länkar till externa sidor
Länk till Eniro
CONCAT('<a href=\"https://personer.eniro.se/resultat/', borrowers.smsalertnumber, '\" target="_blank">', borrowers.smsalertnumber, '</a>' )
Länk till Elib admin
CONCAT('<a href=\"https://admin.elib.se/SuperLibrary/superlibrary_borrower_admin.aspx?sl=2128&card=',borrowers.cardnumber,'\" target="_blank">Elib admin</a>')
Länk till Libris webbsök
Funkar om man har LibrisID i 035
CONCAT('<a href=\"https://libris.kb.se/bib/', SUBSTRING(ExtractValue( bm.metadata, '//datafield[@tag=035]/subfield[@code="a" and contains(text(), "LIBRIS")]'), 9,99), '\" target="_blank">', ExtractValue( bm.metadata, '//datafield[@tag=035]/subfield[@code="a" and contains(text(), "LIBRIS")]'), '</a>' )