This Case statement works well, but I want to run another test in the same calculation and I do not know what function to use and how to combine them.
The Case statement looks for data in any of the three fields, we use it to import from files supplied by schools, some schools format the first and last names of students differently. For example "Lastname, Firstname" and "Firstname, Lastname" and when the two are in separate fields.
DataType = "Last, First (eg: Smith, Jane)" ; TextStyleAdd (Right ( SchoolName_LastCommaFirst ; Length ( SchoolName_LastCommaFirst ) - Position ( SchoolName_LastCommaFirst ; ", " ; 1 ; 1 ) - 1 ) ; Titlecase) ;
DataType = "First, Last (eg: Jane, Smith)" ; TextStyleAdd (Left ( SchoolName_FirstCommaLast ; Position ( SchoolName_FirstCommaLast; ", " ; 1 ; 1 ) - 1 ) ; Titlecase) ;
DataType = "First and Last name in separate columns" ; TextStyleAdd ( SchoolName_First ; Titlecase )
I need to add to it the option to this calculation that if a global field "Use Preferred Name" is set to “Yes”, then use data in a "Preferred First Name" field, if that field is empty, then run the above Case statement. If the global field is not set to “Yes”, then just run the Case statement.
Thank you for your consideration.