Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/24/2024 12:50 AM
Hi Team,
I have created one analytics below to disable the account
SELECT distinct a.accountkey AS acctKey, a.endpointkey, 'disableAccount' AS Default_Action_For_Analytics FROM accounts a JOIN user_accounts ua ON a.accountkey = ua.accountkey JOIN users u ON ua.userkey = u.userkey WHERE u.statuskey IN (1) AND a.endpointkey = 3
AND (DATEDIFF(STR_TO_DATE(u.customproperty53,'%Y-%m-%d %H:%i:%s'),CONVERT_TZ(current_timestamp,'+00:00','+10:00'))=0)
AND u.customproperty53 is not null AND u.customproperty54 is not null
AND STR_TO_DATE(u.customproperty53,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(CONVERT_TZ(current_timestamp,'+00:00','+10:00'),'%Y-%m-%d %H:%i:%s')
AND STR_TO_DATE(u.customproperty54,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(CONVERT_TZ(current_timestamp,'+00:00','+10:00'),'%Y-%m-%d %H:%i:%s')
AND a.status IN (1,'Manually Provisioned','Active')
Problem is first time the DisableAccount task gets created in pending task list now if i try to discontinue the task (from pending task list) and again run the analytics which is not creating the disableAccount task again.
But if i will delete the analytics history list then again the task is getting created after running the analytics.
Anything i am missing in analytic
Please let me know
Thanks
Arnab Pal
Solved! Go to Solution.
07/24/2024 01:13 AM
Hi @ARNAB86 ,
Try below query and check once
SELECT distinct a.accountkey AS acctKey, a.endpointkey, 'disableAccount' AS Default_Action_For_Analytics, sysdate() as todaysDate FROM accounts a JOIN user_accounts ua ON a.accountkey = ua.accountkey JOIN users u ON ua.userkey = u.userkey WHERE u.statuskey IN (1) AND a.endpointkey = 3
AND (DATEDIFF(STR_TO_DATE(u.customproperty53,'%Y-%m-%d %H:%i:%s'),CONVERT_TZ(current_timestamp,'+00:00','+10:00'))=0)
AND u.customproperty53 is not null AND u.customproperty54 is not null
AND STR_TO_DATE(u.customproperty53,'%Y-%m-%d %H:%i:%s') <= DATE_FORMAT(CONVERT_TZ(current_timestamp,'+00:00','+10:00'),'%Y-%m-%d %H:%i:%s')
AND STR_TO_DATE(u.customproperty54,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(CONVERT_TZ(current_timestamp,'+00:00','+10:00'),'%Y-%m-%d %H:%i:%s')
AND a.status IN (1,'Manually Provisioned','Active')
07/24/2024 01:29 AM
Hi Paddy,
it's working means after deleting the task its creating the disableAccount task but problem is now how many times you run the analytics it's creating the disableAccount task that many times and showing in Pending task list.
But i believe if the task is already present it should not create the second one until i discontinue the previous task.
Please let me know.
Thanks
Arnab Pal
07/24/2024 01:32 AM
@ARNAB86 ,
It will not create the task if already exists? Did you tried and created multiple?
07/24/2024 01:47 AM
Actually, whenever i run the analytics job it's creating the disableAccount task.If the task is already there in pending task list it should not create the another task right.
if i run 5 times the analytic job its creating that many task.
07/24/2024 03:01 AM
@ARNAB86 ,
In real time are you running it that many times before Provisioning job(WSRETRY)? If not then, it will not cause any issue, I guess.