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

Add Access Actionable Analytics

void0703
New Contributor III
New Contributor III

Hi All,

I have sql query where i have use group concat to add all those entitlements that i want to give a access to the user but i think group concat doesn't work can you please help me with the query.

Query: 
SELECT U.USERNAME,U.USERKEY AS userKey, A.ACCOUNTKEY AS acctKey ,A.NAME AS accName,(SELECT GROUP_CONCAT(RE.ENTITLEMENT_VALUEKEY) FROM ROLES R JOIN ROLE_ENTITLEMENTS RE ON R.ROLEKEY = RE.ROLEKEY WHERE R.ROLE_NAME = 'Support') AS entvaluekey FROM
ACCOUNTS A
JOIN USER_ACCOUNTS UA ON UA.ACCOUNTKEY = A.ACCOUNTKEY
JOIN USERS U ON U.USERKEY = UA.USERKEY
JOIN ROLE_USER_ACCOUNT RA ON U.USERKEY = RA.USERKEY
JOIN ROLES R ON RA.ROLEKEY = R.ROLEKEY
WHERE U.STATUSKEY = 1
AND U.JOBCODE IN ('50')
GROUP BY U.USERNAME
HAVING MAX(CASE WHEN R.ROLE_NAME IN ('Support') THEN 1 ELSE 0 END) = 0;

 

I want to give access of all those entitlements from the 'Support' Role to particular user using actionable analytics.

 

 

Thanks

6 REPLIES 6

CR
Regular Contributor III
Regular Contributor III

SELECT U.USERNAME,U.USERKEY AS userKey, A.ACCOUNTKEY AS acctKey ,A.NAME AS accName,(SELECT GROUP_CONCAT(RE.ENTITLEMENT_VALUEKEY) as 'EntValuekey' FROM ROLES R JOIN ROLE_ENTITLEMENTS RE ON R.ROLEKEY = RE.ROLEKEY WHERE R.ROLE_NAME = 'TechSupport') AS entvaluekey FROM
ACCOUNTS A
JOIN USER_ACCOUNTS UA ON UA.ACCOUNTKEY = A.ACCOUNTKEY
JOIN USERS U ON U.USERKEY = UA.USERKEY
JOIN ROLE_USER_ACCOUNT RA ON U.USERKEY = RA.USERKEY
JOIN ROLES R ON RA.ROLEKEY = R.ROLEKEY
WHERE U.STATUSKEY = 1
AND U.JOBCODE IN ('50')
GROUP BY U.USERNAME
HAVING MAX(CASE WHEN R.ROLE_NAME IN ('Support') THEN 1 ELSE 0 END) = 0;


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

void0703
New Contributor III
New Contributor III

Have you done any changes in the query that I submitted ?

CR
Regular Contributor III
Regular Contributor III

yes given alias name


Thanks,
Raghu
If this reply answered your question, Please Accept As Solution and hit Kudos.

void0703
New Contributor III
New Contributor III

This is not working as the group_concat is giving entvaluekey together so when i run the analytics query it gives a message 

 

Query returns 

USERNAME USERKEY ACCTKEY ACCNAME ENTVALUEKEY

234523242387321224833,905,1951,1157,2028

Analytics Actionable returns 

Saviynt Security Manager

Alert: Control execution is taking longer than expected. You will be notified when the result is ready
 

ENTVALUEKEY can't be comma seprated.


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

naveenss
All-Star
All-Star

Hi @void0703  can you try below?

SELECT U.USERNAME,U.USERKEY AS userKey, A.ACCOUNTKEY AS acctKey ,A.NAME AS accName,RE.ENTITLEMENT_VALUEKEY as entvaluekey FROM
ACCOUNTS A
JOIN USER_ACCOUNTS UA ON UA.ACCOUNTKEY = A.ACCOUNTKEY
JOIN USERS U ON U.USERKEY = UA.USERKEY
JOIN ROLE_USER_ACCOUNT RA ON U.USERKEY = RA.USERKEY
JOIN ROLES R ON RA.ROLEKEY = R.ROLEKEY JOIN ROLE_ENTITLEMENTS RE on R.ROLEKEY=RE.ROLEKEY
WHERE U.STATUSKEY = 1
AND U.JOBCODE IN ('50')
GROUP BY U.USERNAME
HAVING MAX(CASE WHEN R.ROLE_NAME IN ('Support') THEN 1 ELSE 0 END) = 0;

 

Regards,
Naveen Sakleshpur
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.