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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello I have have a field in Cry 2

Status
Not open for further replies.

tj007

IS-IT--Management
Mar 14, 2003
129
US
Hello

I have have a field in Crystal name (Deviation Type). The values of field are 1 and 2. The 1 means EARLY and the 2 means LATE. I have created an IF and THEN statement that returns TRUE or FALSE. I formatted the field to display yes or no. Is there a way that I can get Crystal to display the word {early) for the number 1, the word (late) for the number 2 ???

Thanks
 
Try a formula (Insert->Field Object->Right Click Formula Fields->New):

if {table.Deviation Type} = 1 then
"Early"
else if {table.Deviation Type} = 2 then
"Late"

I explicitly covered 1 or 2 because I thought you might have null or 0 in some cases.

-k
 
Thanks synapsevampire

You guys make this look so easy. Awesome!!!!!
 
I have another question. I have add group on the early and late returns. How do create a formula to give me the average ratio of early to late???

Thanks
 
To get the ratio of early to late, create two running totals. For {#Early}, select any recurring field, count, evaluate based on a formula:

{table.deviationtype} = 1

Reset never. Repeat steps to create {#Late}, replacing the 1 in the deviation type formula with a 2.

Then create a formula {@ratio}:

{#Early} % {#Late}

-LB
 
I'd add
else "Unexpected" & {table.Deviation Type}
at the end of synapsevampire's formula, just in case there might be values other than 1 and 2 lurking where they are not supposed to be.

A computer system is something that does what you tell it, rather than what you want. I never trust data to stay withing the parameters set for it.

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top