Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Analytic for job function change or update rule trigger

Megha
New Contributor
New Contributor

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

3 REPLIES 3

shivmano
Regular Contributor III
Regular Contributor III

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

Megha
New Contributor
New Contributor

Hello Shiv, 

Thank you for the quick update, we are receiving the below error message when we run the query.

 

Megha_1-1695209321220.png

Same error when running the second query.

Regards,

Megha Urs B R

 

shivmano
Regular Contributor III
Regular Contributor III

@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.