I am trying to set up a KPI that tracks the number of logins for the past 7 days for all users that are part of the persongroup 'HVAC'. I have been trying to figure it out but I keep getting errors. I have been attempting the following SELECT & WHERE clauses, can you see where it goes wrong?
SELECT:
SELECT COUNT(*) session_count FROM logintracking
WHERE:
WHERE logintracking.attemptdate >= TRUNC(SYSDATE)-7 AND EXISTS(SELECT 1 FROM maxuser JOIN person ON person.personid = maxuser.personid JOIN persongroupteam ON persongroupteam.personid = person.personid WHERE maxuser.userid = logintracking.userid AND persongroupteam.persongroup = 'HVAC')
Happy to hear any feedback, thanks in advance!
#EverythingMaximo------------------------------
Noah van P
Brussels Airport Company
------------------------------