In my query Support_tier is a field with 3 numbers eg:- 102, 103, 901,802, 908, 103, 107 and HR_Country is America
My requirement is to have Assignee field to display value based on below:--
If Support_tier have 01 & 02 at the end from above numbers and HR_Country is America then value of Assignee should be 'Earl Vieuten' apart from this all HR_Country which are America should have Assignee as 'Terri'
|eval Assignee= case((substr(Support_tier, -2)="02") AND (HR_Country="America"), "Jeremy", (substr(Support_tier, -2)!="02") AND (HR_Country="America"),"Terri")
Try with brackets around the arguments
| eval Assignee=if(substr(Support_tier,2)="02" OR substr(Support_tier,2)="03","Earl Vieuten","Terri")
Thank for your reply. I have modified my query
|eval Assignee= case(substr(Support_tier, - 2)="02" AND HR_Country="America", "Jeremy")
But other than above Condition all HR_Country to be America should have value "Terri"
Unable to add 2nd condition in my query?
|eval Assignee= case(substr(Support_tier, -2)="02" AND HR_Country="America", "Jeremy", substr(Support_tier, -2)!="02" AND HR_Country="America","Terri")
Getting error with above query
Error in 'eval' command: Type checking failed. 'AND' only takes boolean arguments
|eval Assignee= case((substr(Support_tier, -2)="02") AND (HR_Country="America"), "Jeremy", (substr(Support_tier, -2)!="02") AND (HR_Country="America"),"Terri")
Try with brackets around the arguments
I have an if condition | eval Assignee=if(SupportTier="908","DG 908",Assignee)
Which does not work with query below. PLEASE HELP TO FIX THE QUERY
|eval Assignee= case((substr(Support_tier, -2)="02") AND (HR_Country="America"), "Jeremy", (substr(Support_tier, -2)!="02") AND (HR_Country="America"),"Terri")
In what way does it not work? What is the value of HR_Country in this instance? Also, your if have SupportTier not Support_tier, is this just a typo or a different field?
HR_Country =America only when SupportTier is 908
I will write the conditions again:--
SupportTier =908 & HR_Country = America, Assignee = DG 908
Also to be added with below command
|eval Assignee= case((substr(Support_tier, -2)="02") AND (HR_Country="America"), "Jeremy", (substr(Support_tier, -2)!="02") AND (HR_Country="America"),"Terri")
OK this new condition has to appear earlier in the case statement (at least before (substr(Support_tier, -2)!="02") AND (HR_Country="America"),"Terri")
| eval Assignee= case(((Support_tier="908") AND (HR_Country="America")), "DG 908", (substr(Support_tier, -2)="02") AND (HR_Country="America"), "Jeremy", (substr(Support_tier, -2)!="02") AND (HR_Country="America"),"Terri")
The new query doesn't work as for SupportTier 908 & HR_Country Assignee field turns out to be 'Terri'
You have multiple evals where country is UNITED STATES OF AMERICA so you might want to group these together
| eval Assignee=if(HR_Country="America",case((Support_tier="908"), "DG 908", (Support_tier="909"), "Jimmy Terrell", (substr(Support_tier, -2)="01"), "Jeremy Scala", (substr(Support_tier, -2)="02"), "Jeremy Scala", 1=1 ,"Meinke, Lance and Terry"), Assignee)
Essentially, if it is 908, 909, ends in 01, or ends in 02, it goes to specified people, everything else goes to Meinke, Lance and Terry
Thank you for your great help👍👍👍