So I cribbed this SQL to find top titles and does appear to be working but I can not figure out why the reports circ count doesnโt always match Polaris. Could it be unique patrons or no renewals? If anyone has suggests, it would be much appreciated ![]()
Here is my code:
SELECT TOP 40 โ Pulls the top 40 titles, adjust as needed
br.BibliographicRecordID AS [BibliographicRecordID],
br.BrowseTitle AS [Title],
br.BrowseAuthor AS [Author],
material.numValue AS [MaterialTypeID],
mat.Description AS [Material Type],
shelfloc.numValue AS [ShelfLocationID],
sl.Description AS [Shelf Location],
COUNT(shelfloc.numValue) AS [Circ Count]
FROM
PolarisTransactions.Polaris.TransactionHeaders th WITH (NOLOCK)
INNER JOIN โ Get the MaterialTypeID
PolarisTransactions.Polaris.TransactionDetails material WITH (NOLOCK)
ON (th.TransactionID = material.TransactionID AND material.TransactionSubTypeID = 4)
LEFT JOIN โ Get the ShelfLocationID if itโs there
PolarisTransactions.Polaris.TransactionDetails shelfloc WITH (NOLOCK)
ON (th.TransactionID = shelfloc.TransactionID AND shelfloc.TransactionSubTypeID = 296)
INNER JOIN โ Get the ItemRecordID
PolarisTransactions.Polaris.TransactionDetails item WITH (NOLOCK)
ON (th.TransactionID = item.TransactionID AND item.TransactionSubTypeID = 38)
LEFT JOIN โ Get item record information
Polaris.Polaris.CircItemRecords cir WITH (NOLOCK)
ON (cir.ItemRecordID = item.numValue)
LEFT JOIN โ Get bibliographic record information
Polaris.Polaris.BibliographicRecords br WITH (NOLOCK)
ON (br.BibliographicRecordID = cir.AssociatedBibRecordID)
INNER JOIN โ Get material type information
Polaris.Polaris.MaterialTypes mat WITH (NOLOCK)
ON (mat.MaterialTypeID = material.numValue)
LEFT JOIN โ Get shelf location information
Polaris.Polaris.ShelfLocations sl WITH (NOLOCK)
ON (sl.ShelfLocationID = shelfloc.numValue)
WHERE โ Check outs
th.TransactionTypeID = 6001
AND โ Adjust dates as needed
th.TranClientDate BETWEEN โ2025-07-01 00:00:00.000โ AND โ2026-06-23 23:59:59.999โ
AND โ Material type
mat.MaterialTypeID = 110
AND โ Exclude deleted bibs
br.BibliographicRecordID IS NOT NULL
GROUP BY
br.BibliographicRecordID,
br.BrowseTitle,
br.BrowseAuthor,
material.numValue,
mat.Description,
shelfloc.numValue,
sl.Description
ORDER BY
COUNT(shelfloc.numValue) DESC