Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/02/2024 04:56 AM
Hi,
Our requirement is to change status to Inactive for users whose
(a)CP35 is null and
(b)start date is 21 days or more from current date.
We are using the below preprocessor but the job is failing.
{
"ADDITIONALTABLES": {
"USERS": "SELECT enddate,username,systemusername,startdate,customproperty35 FROM users"
},
"COMPUTEDCOLUMNS": [
"statuskey"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET statuskey =case when NEWUSERDATA.customproperty35 is null and (datediff(sysdate(),DATE_FORMAT(NEWUSERDATA.startdate,'%Y-%m-%d %H:%i:%s')) >=21) then 'inactive' else 'active' end"
]
}
Is there some modification required in the preprocessor. Please suggest.
08/02/2024 05:12 AM
@SanjeetaRao try this
{
"ADDITIONALTABLES": {
"USERS": "SELECT enddate,username,systemusername,startdate,customproperty35 FROM users"
},
"COMPUTEDCOLUMNS": [
"statuskey"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET statuskey =case when NEWUSERDATA.customproperty35 is null and (datediff(sysdate(),DATE_FORMAT(NEWUSERDATA.startdate,'%Y-%m-%d %H:%i:%s')) >=21) then 0 else 1 end"
If that doesn't work try giving 1 and 0 in single quotes
]
}
08/02/2024 05:27 AM
Hi @NM
We tried with 0,1 and '0','1'. We are getting the same error.
Error in Users Import - Error while processing data: Unknown column 'TEMPNEWUSERS_42793.customproperty35' in 'field list'.
Could you please help
08/02/2024 05:47 AM
Try
case when customproprty35 instead of adding newuserdata at the start.
08/04/2024 11:45 PM
Hi @NM ,
I ran the job after replacing NEWUSERDATA.customproperty35 with just customproperty35.
It gave the below error:
Error in Users Import - Error while processing data: Unknown column 'customproperty35' in 'field list'
08/02/2024 05:27 PM
{
"ADDITIONALTABLES": {
"USERS": "SELECT enddate, username, systemusername, startdate, customproperty35 FROM users"
},
"COMPUTEDCOLUMNS": [
"statuskey"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET statuskey = CASE
WHEN NEWUSERDATA.customproperty35 IS NULL
AND DATEDIFF(SYSDATE(), DATE_FORMAT(NEWUSERDATA.startdate, '%Y-%m-%d %H:%i:%s')) >= 21
THEN 0
ELSE 1
END"
]
}
08/04/2024 11:25 PM
Hi @rushikeshvartak ,
We tried the above solution. But we are getting the same error we were getting earlier.
Error in Users Import - Error while processing data: Unknown column 'TEMPNEWUSERS_43934.customproperty35' in 'field list'
08/05/2024 07:17 PM
{
"ADDITIONALTABLES": {
"USERS": "SELECT enddate, username, systemusername, startdate, customproperty35 FROM users"
},
"COMPUTEDCOLUMNS": [
"statuskey", "customproperty35"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET statuskey = CASE
WHEN NEWUSERDATA.customproperty35 IS NULL
AND DATEDIFF(SYSDATE(), DATE_FORMAT(NEWUSERDATA.startdate, '%Y-%m-%d %H:%i:%s')) >= 21
THEN 0
ELSE 1
END"
]
}