Small filters and helpers you can drop straight into Halo reports
HALOScoped reporting by agent teamLimit faults to the logged-in agent’s team(s)
Limit faults to the logged-in agent’s team(s)
By default, SQL reports can return faults across every team. This filter scopes the result set so
each agent only sees faults where faults.sectio_ matches one of their section memberships.
WHERE clause filter
AND EXISTS (
SELECT 1
FROM unamesection us
JOIN sectiondetail sd ON sd.SdId = us.USSdid
WHERE us.USUnum = $agentid
AND UPPER(LTRIM(RTRIM(sd.SDSectionName))) = UPPER(LTRIM(RTRIM(faults.sectio_)))
)
How it works
$agentid resolves to the logged-in agent’s user ID.
unamesection links a user (USUnum) to section membership.
sectiondetail contains the section name used for comparison.
The EXISTS check passes if any team match is found.
UPPER/LTRIM/RTRIM normalises casing and whitespace.