Get a count of staff using Leap per branch

Based on This query to get a list of Leap logins, here’s a query to get a count of staff using Leap at each Branch. Which could help if you’re in a consortium and are working on moving staff over to Leap.

SELECT
    o.Name AS [Branch / Library],
	COUNT(DISTINCT pu.Name) as "User Count"

FROM
    PolarisTransactions.Polaris.TransactionHeaders th WITH (NOLOCK)

INNER JOIN -- Looking for system logins
    PolarisTransactions.Polaris.TransactionDetails td WITH (NOLOCK)
    ON (th.TransactionID = td.TransactionID AND td.TransactionSubTypeID = 235)
INNER JOIN
    Polaris.Polaris.Organizations o WITH (NOLOCK)
    ON (o.OrganizationID = th.OrganizationID)
INNER JOIN
    Polaris.Polaris.PolarisUsers pu WITH (NOLOCK)
    ON (pu.PolarisUserID = th.PolarisUserID)

WHERE -- System login
    th.TransactionTypeID = 7200
AND -- Leap login
    td.numValue = 38
AND -- Adjust dates as needed.
    th.TranClientDate BETWEEN '2025-04-01 00:00:00.000' AND '2025-04-30 23:59:59.999'

GROUP BY o.Name
ORDER BY "User Count"
1 Like