Click HERE to see how Saviynt Intelligence is transforming the industry. |
06/13/2024 02:53 AM
Hi Team,
We are trying to generate account name rule using if else condition. But it is not working. The below one was provided in document and it is working fine. If I update with my logic it is not working.
In Document:
concat(users.firstname, users.city, (case when (users.lastname = 'Admin')
THEN
concat(users.firstname,users.location)
ELSE
users.lastname
END))
My Logic:
concat(user.country,user.location,user.firstname,user.lastname,user.customproperty40,
(case when
(user.comments = 'Workday Imported')
THEN
Concat(LOWER(SUBSTRING(user.country, 1, 1)),
LOWER(user.location),
LOWER(SUBSTRING(user.firstname, 1, 1)),
LOWER(SUBSTRING(user.lastname, 1, 2)),
LOWER(SUBSTRING(user.customproperty40, LENGTH(user.customproperty40) - 1, 1))
)))ELSE
CONCAT(user.firstname,user.lastname,(case when (user.employeeType = 'Call Center' AND user.location = 'Malaysia') THEN
CONCAT(
'cctd',
LOWER(SUBSTRING(user.firstname, 1, 4)),
LOWER(SUBSTRING(user.lastname, 3, 1))
END)))
Could someone help me to correct the query?
Thanks,
Bhargavi Padaraju.
06/13/2024 03:07 AM
@Bhargavi3 Use users. instead of user
example: users.country
First to troubleshoot try with simple query ,then add conditions.
06/13/2024 03:08 AM
@SumathiSomala , Thanks for the reply.
Yes, I tested with users also did not work.
06/13/2024 09:58 PM
CONCAT( COALESCE(user.country, ''), COALESCE(user.location, ''), COALESCE(user.firstname, ''), COALESCE(user.lastname, ''), COALESCE(user.customproperty40, ''), (CASE WHEN user.comments = 'Workday Imported' THEN CONCAT( LOWER(SUBSTRING(COALESCE(user.country, ''), 1, 1)), LOWER(COALESCE(user.location, '')), LOWER(SUBSTRING(COALESCE(user.firstname, ''), 1, 1)), LOWER(SUBSTRING(COALESCE(user.lastname, ''), 1, 2)), LOWER(SUBSTRING(COALESCE(user.customproperty40, ''), LENGTH(COALESCE(user.customproperty40, '')) - 1, 1)) ) ELSE CONCAT( COALESCE(user.firstname, ''), COALESCE(user.lastname, ''), (CASE WHEN user.employeeType = 'Call Center' AND user.location = 'Malaysia' THEN CONCAT( 'cctd', LOWER(SUBSTRING(COALESCE(user.firstname, ''), 1, 4)), LOWER(SUBSTRING(COALESCE(user.lastname, ''), 3, 1)) ) ELSE '' END) ) END) )