Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/16/2024 04:17 AM
Hi,
We have a requirement where we have to create disable account task for the inscope applications for that we are creating datasets where we are storing endpointname and endpointkey and relating this inside analytics for creating tasks. Please let me know if am missing anything
Query:
SELECT distinct u.username,u.displayname as 'User Full Name',u.email, a.name 'Application Account Name',a.accountkey as acctKey, e.displayname 'Application Name', a.CREATED_ON 'Account Creation Date', CASE WHEN a.status = 1 THEN 'ACTIVE' ELSE a.status END AS 'Account Status', a.lastlogondate, 'disableAccount' as 'Default_Action_For_Analytics' FROM accounts a inner join endpoints e on a.ENDPOINTKEY=e.ENDPOINTKEY inner join dataset_values ds on ds.attribute2= e.endpointkey inner join user_accounts ua on a.accountkey=ua.accountkey inner join users u on u.userkey = ua.userkey where date(a.lastlogondate) = CURDATE() - INTERVAL 90 DAY and ds.attribute2=e.endpointkey
Solved! Go to Solution.
08/16/2024 04:23 AM - edited 08/16/2024 04:30 AM
Hi @User_ID_Singh1 ,
Query returning result when ran in Data Analyzer? Can you try that once and check the result. Also make sure to checked the Save Data option for field Where do you want to save your data?
08/16/2024 05:18 AM
Yes query working in data analyser
08/16/2024 05:48 AM
You are triggering the analytics though Job or executing manually?
08/16/2024 06:13 AM
we tried both ways Job and manual, no help
08/16/2024 06:14 AM
Hi @vivekmistry , try what I suggested below once..
08/16/2024 06:24 AM
08/16/2024 07:00 AM
Yes all the configuration is in place.
Task getting created for this query:
SELECT distinct u.username,u.displayname as 'User Full Name',u.email, a.name 'Application Account Name',a.accountkey as acctKey, e.displayname 'Application Name', a.CREATED_ON as 'Account Creation Date', CASE WHEN a.status = 1 THEN 'ACTIVE' ELSE a.status END AS 'Account Status', a.lastlogondate, 'disableAccount' as Default_Action_For_Analytics FROM accounts a inner join endpoints e on a.ENDPOINTKEY=e.ENDPOINTKEY inner join user_accounts ua on a.accountkey=ua.accountkey inner join users u on u.userkey = ua.userkey where date(a.lastlogondate) =DATE_SUB(CURDATE(), INTERVAL 90 DAY) and e.customproperty31= 'True'
But task is not getting created for query :
SELECT distinct u.username,u.displayname as 'User Full Name',u.email, a.name 'Application Account Name',a.accountkey as acctKey, e.displayname 'Application Name', a.CREATED_ON 'Account Creation Date', CASE WHEN a.status = 1 THEN 'ACTIVE' ELSE a.status END AS 'Account Status', a.lastlogondate, 'disableAccount' as Default_Action_For_Analytics FROM accounts a inner join endpoints e on a.ENDPOINTKEY=e.ENDPOINTKEY inner join dataset_values ds on ds.attribute2= e.endpointkey inner join user_accounts ua on a.accountkey=ua.accountkey inner join users u on u.userkey = ua.userkey where date(a.lastlogondate) =DATE_SUB(CURDATE(), INTERVAL 90 DAY) and ds.attribute2=e.endpointkey
08/16/2024 07:05 AM
SELECT DISTINCT
u.username,
u.displayname AS 'User Full Name',
u.email,
a.name AS 'Application Account Name',
a.accountkey AS acctKey,
e.displayname AS 'Application Name',
a.CREATED_ON AS 'Account Creation Dat',
CASE WHEN a.status = 1 THEN 'ACTIVE' ELSE a.status END AS 'Account State',
a.lastlogondate as 'Last Login',
'disableAccount' AS Default_Action_For_Analytics
FROM
accounts a
INNER JOIN endpoints e ON a.ENDPOINTKEY = e.ENDPOINTKEY
INNER JOIN user_accounts ua ON a.accountkey = ua.accountkey
INNER JOIN users u ON u.userkey = ua.userkey
WHERE
DATE(a.lastlogondate) = CURDATE() - INTERVAL 90 DAY
AND e.customproperty31 = 'True';
08/16/2024 07:15 AM
With using CP31 we are able to create the task, but we have to use datasets table for creating task.
08/16/2024 07:26 AM
Does attribute 2 contains proper endpointkey ?
08/16/2024 07:29 AM
Yes:
08/16/2024 07:36 AM
Hi @vivekmistry I will suggest create a new analytics.
08/16/2024 07:54 AM
You have not specified dataset name
SELECT DISTINCT
u.username,
u.displayname AS 'User Full Name',
u.email,
a.name AS 'Application Account Name',
a.accountkey AS acctKey,
e.displayname AS 'Application Name',
a.CREATED_ON AS 'Account Creation Dat',
CASE WHEN a.status = 1 THEN 'ACTIVE' ELSE a.status END AS 'Account State',
a.lastlogondate as 'Last Login',
'disableAccount' AS Default_Action_For_Analytics
FROM
accounts a
INNER JOIN endpoints e ON a.ENDPOINTKEY = e.ENDPOINTKEY
INNER JOIN user_accounts ua ON a.accountkey = ua.accountkey
INNER JOIN users u ON u.userkey = ua.userkey
inner join dataset_values ds on ds.attribute2= e.endpointkey
WHERE
DATE(a.lastlogondate) = CURDATE() - INTERVAL 90 DAY
AND ds.attribute2=e.endpointkey
And ds.datasetname='RUSHI'
08/16/2024 08:56 AM
Thanks it worked
08/16/2024 09:08 AM
✅Please click the 'Accept As Solution' button on the reply that best answers your original question and hit 'Kudos' button 👍.
08/16/2024 06:02 AM
Hi @User_ID_Singh1 , if you are creating task using analytics job
Add below in your query
sysdate() as currentDate
08/16/2024 08:48 AM
Hello @User_ID_Singh1 ,
Can you check the logs when running the analytics and share those here please?
Thanks!
Regards,
Rahul
Please accept this as solution & give kudos if it resolves your issue.