Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/19/2023 07:14 AM
Hi Team,
We have requirement to create analytic when a particular rule gets triggered like User update rule for job function change. Can we please get any sample query for this requriement.
Regards,
Megha Urs B R
09/20/2023 03:28 AM - edited 09/20/2023 03:30 AM
You should be able to get the users that has the particular rule triggered from the usershistory table. Here is a sample query
select b.USERKEY from usershistory a,users b where DATEDIFF(now(),a.UPDATEDATE) < 1 AND a.USERKEY = b.USERKEY AND b.STATUSKEY =1 and a.ruleruns like '%Rulename%'
SELECT URR.USERRULERUNDATA_ARCHIVEKEY AS USERRULERUNDATAKEY , URR.USERKEY AS USERKEY , URR.JOBGROUP AS JOBGROUP ,
URR.CHANGEMAP AS CHANGEMAP , URR.RULETYPE AS RULETYPE , URR.DETECTIVE AS DETECTIVE ,URR.BIRTHRIGHT AS BIRTHRIGHT , URR.PROCESSED AS PROCESSED , URR.COMMENTS AS COMMENTS ,URR.JOBID AS JOBID , URR.PARENTJOBID AS PARENTJOBID , URR.UPDATEDATE AS UPDATEDATE ,URR.EVENTSOURCE AS EVENTSOURCE ,URR.NEWDATA AS NEWDATA, URR.OLDDATA AS OLDDATA ,URR.RULEACTIONFAILED AS RULEACTIONFAILED, URR.RULEACTIONSUCCESSFUL AS RULEACTIONSUCCESSFUL ,
URR.RULEACTIONTOBEFIRED AS RULEACTIONTOBEFIRED , URR.TRAIL AS TRAIL , URR.USERHISTORYKEY AS USERHISTORYKEY ,U.USERNAME
FROM USERRULERUNDATA_ARCHIVE URR , USERS U WHERE
URR.USERKEY = <userkey>
ORDER BY URR.UPDATEDATE DESC
09/20/2023 04:29 AM
Hello Shiv,
Thank you for the quick update, we are receiving the below error message when we run the query.
Same error when running the second query.
Regards,
Megha Urs B R
09/24/2023 10:46 PM
@Megha , you may not be able to run the query against usershistory table from the data analyser. Please try running it using an analytics report from the analytics interface.