Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Translating Values in a Mutlivalue field 1

Status
Not open for further replies.

griffter

Programmer
Oct 17, 2005
36
GB
I am completely new to Crystal Reports. I have linked into my data source, some of the fields have number values which signify text values in the system. What formula do I need to change these number values to the text I want, ie

If field x = 1 Then "blah blah, elseif Field x = 2 then "blah blah

I have never used the formula editor and am not sure the correct syntax for this kind of formula.

Any help would be much appreciated
 
So the text is in another field in the same table? First, place your number field and your text field in the details section and observe how they relate to each other.

If you want only the text related to certain (not all) numbers in field1, then use a conditional formula like:

if {table.field1} in [1,3] then {table.text}

-LB
 
Thanks for the reply. Would life was so easy!! The values I want to translsate to do not exist in any table, therefore my conclusion was I will need to translate them in Crystal Reports.
 
You need to explain more specifically what you are trying to do and where these fields or values are coming from.

-LB
 
Okay

I have a field which returns an array of numbers:-

4
16
10
12
5

In the system I am extracting the data from these numbers equate to the following

4="Patient Unblinding"
16 = "Off Line Resupply"

and so on. So I want to create a field which will translate these values according to the number in the array.
 
In the formula editor, create a formula:

select {table.field} //the one with the numbers
case 4 : "Patient Unblinding"
case 16 : "Off Line Resupply"
case 10 : "Other text" //etc.
default : ""

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top