How to determine the number of unique users based on badge (prox) usage
  • 13 Mar 2023
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

How to determine the number of unique users based on badge (prox) usage

  • Dark
    Light
  • PDF

Article summary

PROBLEM/NEED

In order to understand usage data (typically for licensing), an organization would like to know how many unique users used their badges in a specific time range.

METHOD 1:

Badge/user association is stored in a SQL database. The records in the database include the last time a user tapped their badge (CacheTime column). This time can be used to determine how many users used their badge in the last X number of days.

STEPS

1. Verify the ProxCard SQL database

To determine the ProxCard database, on an XA server, open the eXactACCESS Server Configuration utility, select the Database button, and verify the name of the database in the ProxCard tab:

image.png

  1. As a user that has permissions to read and write to the database , open the ProxCard SQL database with a tool that will allow you to run SQL queries (e.g. SQL Server Management Studio)

image.png

  1. Run the following query to get the number of records of users that have tapped their badge in the last 90 days:
SELECT count(*) FROM RFIDtoXAName
WHERE CacheTime >= DATEADD(day, -90, GETDATE())

METHOD 2:

Badge taps are stored in the Audit SQL database. This data can be queried to not only get the number of unique users that have tapped their badge, but how many times they have tapped their badge.

STEPS

  1. Verify the Audit SQL database

    To determine the ProxCard database, on an XA server, open the eXactACCESS Server Configuration utility, select the Database button, and verify the name of the database in the AuditServer tab:

  2. As a user that has permissions to read and write to the database , open the Audit SQL database with a tool that will allow you to run SQL queries (e.g. SQL Server Management Studio)

  3. Here are examples of queries you can run to get badge tap usage data from the audit database:

QUERY 1 - Number of users that have tapped their badge

Run the following query to get the number of records of users that have tapped their badge between two specific dates.

SELECT count(1)
FROM staging 
WHERE attribs_value like '%BADGE%' and 
   (time_start >= '20200400000000' and time_start <= '20200626000000')

NOTE

The time_start field stores time in the format of YYYYMMDDHHMMSS

QUERY 2: Badge Tap Count by User

The following query pulls badge taps for unique users from a specific date range:

SELECT user_uname, count(1)
FROM staging 
WHERE attribs_value like '%BADGE%' and (time_start >= '20200400000000' and time_start <= '20200626000000')
group by user_uname 
QUERY 3 - Users that have tapped their badge

The following query pulls the number of unique users that have tapped their badge in a specific date range:

SELECT count (DISTINCT user_uname)
FROM staging
WHERE attribs_value like '%BADGE%' and (time_start >= '20200400000000' and time_start <= '20200626000000')

Was this article helpful?