Preprocessor query Case problem Help needed

maheshbhoi_it
Regular Contributor
Regular Contributor

Hello Team,

 

I am setting companyName =AB if employeetype is Employee OR interns , else companyname=null

Tried following and not working , can someone help me correct, I tried couple of changes not working, logs attached?

{
"ADDITIONALTABLES": {
"USERS": "SELECT employeetype, Departmentname, COSTCENTER, firstname, lastname FROM USERS"
},
"COMPUTEDCOLUMNS": [
"companyname",
"employeetype"
],
"PREPROCESSQUERIES": [
"UPDATE NEWUSERDATA SET companyname= CASE WHEN (employeetype == "Employee") then 'AB' CASE WHEN (employeetype == "Interns") then 'Apple Bank' ELSE '' end"
]
}

1 REPLY 1

maheshbhoi_it
Regular Contributor
Regular Contributor

Resolved this with bellow preprocessor query

"UPDATE NEWUSERDATA SET COMPANYNAME = CASE WHEN (employeetype = 'Employee' OR employeetype = 'Interns') THEN 'AB' ELSE NULL END;",