Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/09/2024 02:55 AM
Hello, everyone.
We have a requirement to sort by employee number, and my query sorts it in Data Analyzer but not in Analytics Report.
'ORDER BY 'Employee ID''
Any suggestions on how to do this would be greatly appreciated.
08/09/2024 02:55 AM
Share query
08/09/2024 03:30 AM
SELECT
U.USERNAME AS 'Employee ID',
U.EMPLOYEETYPE,
U.FIRSTNAME,
U.LASTNAME,
U.EMAIL AS 'Email ID',
U.DEPARTMENTName AS 'DEPARTMENT',
U.REGION,
U.LOCATION AS 'HCM Location',
U.Customproperty52 AS 'Country',
CASE WHEN U.STATUSKEY = 0 THEN 'INACTIVE' ELSE 'ACTIVE' END AS 'USER STATUS',
U.STARTDATE AS 'START DATE',
U.ENDDATE AS 'END DATE',
U.CREATEDATE AS 'CREATED ON',
U.Customproperty28 AS 'AD OU Site Name',
A.ACCOUNTID AS 'Account ID',
E.ENDPOINTNAME AS 'ENDPOINTNAME'
FROM
ACCOUNTS A,
USER_ACCOUNTS UA,
USERS U,
ENDPOINTS E
WHERE
A.ACCOUNTKEY = UA.ACCOUNTKEY
AND U.USERKEY = UA.USERKEY
AND A.ENDPOINTKEY = E.ENDPOINTKEY
AND U.STARTDATE > DATE_SUB(CURDATE(), INTERVAL 7 DAY)
AND U.STATUSKEY = 1
AND U.CUSTOMPROPERTY17 = 'Active'
ORDER BY 'Employee ID'
08/09/2024 06:29 AM
Saviynt by default sort in ascending first column report
08/12/2024 11:09 PM
@rushikeshvartak Thank you for your response!
The analytics report I am generating does not come with sort.
08/12/2024 11:12 PM - edited 08/12/2024 11:15 PM
Saviynt by default sort in ascending first column report
SELECT
U.USERNAME AS 'Employee ID',
U.EMPLOYEETYPE,
U.FIRSTNAME,
U.LASTNAME,
U.EMAIL AS 'Email ID',
U.DEPARTMENTName AS 'DEPARTMENT',
U.REGION,
U.LOCATION AS 'HCM Location',
U.Customproperty52 AS 'Country',
CASE WHEN U.STATUSKEY = 0 THEN 'INACTIVE' ELSE 'ACTIVE' END AS 'USER STATUS',
U.STARTDATE AS 'START DATE',
U.ENDDATE AS 'END DATE',
U.CREATEDATE AS 'CREATED ON',
U.Customproperty28 AS 'AD OU Site Name',
A.ACCOUNTID AS 'Account ID',
E.ENDPOINTNAME AS 'ENDPOINTNAME'
FROM
ACCOUNTS A
JOIN USER_ACCOUNTS UA ON A.ACCOUNTKEY = UA.ACCOUNTKEY
JOIN USERS U ON U.USERKEY = UA.USERKEY
JOIN ENDPOINTS E ON A.ENDPOINTKEY = E.ENDPOINTKEY
WHERE
U.STARTDATE > DATE_SUB(CURDATE(), INTERVAL 7 DAY)
AND U.STATUSKEY = 1
AND U.CUSTOMPROPERTY17 = 'Active'
ORDER BY
U.USERNAME;
08/13/2024 01:13 AM
Analytics Output
08/13/2024 01:16 AM
Its expected behavior as column is first column
08/09/2024 03:33 AM
Try this
SELECT
U.USERNAME AS 'Employee ID',
U.EMPLOYEETYPE,
U.FIRSTNAME,
U.LASTNAME,
U.EMAIL AS 'Email ID',
U.DEPARTMENTName AS 'DEPARTMENT',
U.REGION,
U.LOCATION AS 'HCM Location',
U.Customproperty52 AS 'Country',
CASE WHEN U.STATUSKEY = 0 THEN 'INACTIVE' ELSE 'ACTIVE' END AS 'USER STATUS',
U.STARTDATE AS 'START DATE',
U.ENDDATE AS 'END DATE',
U.CREATEDATE AS 'CREATED ON',
U.Customproperty28 AS 'AD OU Site Name',
A.ACCOUNTID AS 'Account ID',
E.ENDPOINTNAME AS 'ENDPOINTNAME'
FROM
ACCOUNTS A,
USER_ACCOUNTS UA,
USERS U,
ENDPOINTS E
WHERE
A.ACCOUNTKEY = UA.ACCOUNTKEY
AND U.USERKEY = UA.USERKEY
AND A.ENDPOINTKEY = E.ENDPOINTKEY
AND U.STARTDATE > DATE_SUB(CURDATE(), INTERVAL 7 DAY)
AND U.STATUSKEY = 1
AND U.CUSTOMPROPERTY17 = 'Active'
ORDER BY Employee ID asc
08/12/2024 11:11 PM
@NM Thank you for your response!
It is not coming with sort with the above report.
08/12/2024 11:17 PM
@Tejas_Thakkar3 , what format do you need?