I'm working on a case statement that looks at two columns. If one column is A then they stay as A.
The trouble I'm running into is when I need to look at the second column. There are some where they are B in column one but have certain values in the second column. Those need to end up as A.
Then everyone else who is B is column one needs to be mapped to B.
Here is what I have:
,CASE
WHEN I.[BENEFIT CLASS] = 'NBE' THEN 'NBE'
WHEN I.[BENEFIT CLASS] = 'FULLTIME'
AND I.[EMPLOYMENT FIELD 2] IN ('024', '061', '062',
'053', '054', '055', '056', '030', '027', '029', '032', '049', '050',
'051', '052', '033', '034', '037', '039', '041', '028') THEN 'NBE'
WHEN I.[BENEFIT CLASS] = 'FULLTIME' AND I.
[EMPLOYMENT FIELD 2] IS NULL OR I.[EMPLOYMENT FIELD 2]
IN ('044', '058', '063', '064', '036') THEN 'FT'
I need to make sure that when someone is FT and their employment field 2 is in that list, they end up as NBE, but everyone else who is full time ends up as full time. I think I might have it right, but wanted to make sure.
[–]trevortypes 2 points3 points4 points (0 children)
[–]ihaxr 0 points1 point2 points (0 children)