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!

Displaying Numerous Results in One field

Status
Not open for further replies.

LDickenson

IS-IT--Management
Jun 11, 2007
27
Hi

I have 10 fields that are checkboxes there could be one ticked or 5 ticked or even 10. I have tried to do a formula like

if field 1 = y and field 2 = Y then 'red and blue' else
if field 1 = y and field 4 = yes then 'red and green'

and so on and I need to display every possible scenario - does anyone have any ideas.

Much appreciated.

Thanks,

Lisa
 
I am assuming you have only 4 colors. Expand the statments for the correct number below.

I would create an array like this:

stringvar array colors := ["red","blue","yellow","green"]

and so on, one cell for each color.
I am assuming that each of the check boxes is a boolean field (true or false).


set up a formula like this:

stringvar array colors := ["red","blue","yellow","green"];
stringvar output := "";
if {table.field1} then output := output +colors[1]+",";
if {table.field2} then output := output +colors[2]+",";
if {table.field3} then output := output +colors[3]+",";
if {table.field4} then output := output +colors[4]+",";
output

That will give you a string witn the various colors, separated by commas with a comma at the end.

I hope that helps






Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top