6 Replies Latest reply on Mar 9, 2017 5:33 AM by Cris Cook

    Calculated field using if statement with multiple values

    Rani Nair

      Hi,

       

      I have the below statement to create a calculated field. is this the correct way of writing this?

       

      IF CONTAINS([Examcode],'MKNEL','MKNER','MKNEB') Then 'Radiology - General'

      ELSEIF  CONTAINS([Examcode],'MMCSFS','MCMOP','MCAMFC','MCMFSC','MCSPS','MCSFS','MCMFS','MCORP','MCARD', 'MCVIA', 'MCRPS',

      'MAOTHC', 'MCHIL', 'MCMPV', 'MCCMS', 'MCMFVC', 'MAAOW') then 'Cardiac MRI'

      ELSEIF  CONTAINS([Examcode],'CARD', 'CPET', 'ETT', 'HOLT24LEAD', 'HOLT24HR', 'HOLT48HR', 'HOLT7DAY', 'RTEST', 'TILT', 'TTE',

      'TTEPAED') then 'Cardiac ECHO'

      ELSEIF [Refdepartmentid]='7' then 'Radiology - AMW'

      ELSEIF [Refdepartmentid] <> '7' then 'Radiology - General'

      ELSEIF [Refdepartmentid]='34' then 'Radiology - Rose'

      ELSEIF [Refdepartmentid]='43' then 'Radiology - NEL'

      ELSEIF [Refdepartmentid]='55' then 'Radiology - QMH'

      END