Calculating Unique Event Attendance Without Counting Duplicate Badge Scans
RFID and QR-based event systems often produce multiple records for the same credential.
Counting all these records as individual attendees can create misleading reports.
Consider this simplified JavaScript example.
const scans = [
{ credentialId: "A101", checkpoint: "entrance" },
{ credentialId: "A101", checkpoint: "entrance" },
{ credentialId: "A102", checkpoint: "entrance" },
{ credentialId: "A103", checkpoint: "entrance" },
{ credentialId: "A101", checkpoint: "hall-a" }
];
const entranceScans = scans.filter(
scan => scan.checkpoint === "entrance"
);
const uniqueAttendees = new Set(
entranceScans.map(scan => scan.credentialId)
);
console.log(uniqueAttendees.size); // 3
The original dataset contains five scan records.
Four occurred at the entrance, but only three distinct credentials were detected there.
This demonstrates why raw activity counts and unique attendance metrics should be calculated separately.
What about production systems?
A real-world application also needs to consider:
- Event and date boundaries.
- Credential replacement.
- Entry and exit direction.
- Duplicate event delivery.
- Multiple checkpoints.
- Delayed activity.
- Data privacy and authorization.
A simple Set is useful for understanding the concept, but larger systems may require database-backed aggregation and more detailed business rules.
For additional business context, StampIQ explains how RFID attendee tracking is applied in event management.
The important lesson is to define the metric before building the calculation.
Disclosure: This educational example is contributed by the StampIQ team.
Top comments (0)