Skip to Content
0
Former Member
Nov 30, 2009 at 09:46 PM

Using select case to transform enumeration

23 Views

In my XML data source I have gender enumerated as 0 = Female; 1 = Male; 2 = Transgendered Male to Female etc. I want the word descriptions to appear instead of the numbers, so I attempted to create a formula field using a case statment as below.

Select Case {dataroot/SourceDatabase/Client/Gender.Unhashed}

Case 1

formula = male

Case 2

formula = female

End Select

When I check formula I the fist instance of the word Case is highlighted and I get a message saying a numeric value, currency value, boolean, date, time, or string is expected. Am I using the wrong syntax or the wrong function? Is there a better approach.