February 12, 200224 yr If(IsOutsideHitter = "Yes", "OH, ", "") & If(IsMiddleHitter="Yes", "MH, ", "") & If(IsSetter="Yes", "Set, ", "") & If(IsDenfense="Yes", "Def", "") All four fields have to be marked "Yes" for the calculation ot work. I am just trying to create a text string that shows what has been selected. The "&"s are acting like "and if". [ February 12, 2002, 07:33 AM: Message edited by: signal ]
February 12, 200224 yr Try this: code: Case( IsOutsideHitter = "Yes", "OH, ", IsMiddleHitter="Yes", "MH, ", IsSetter="Yes", "Set, ", IsDenfense="Yes", "Def", "" ) [ February 12, 2002, 07:55 AM: Message edited by: The Bridge ]
February 12, 200224 yr Author It is possible to select more than one option. Won't case() exit as soon as one option is satisfied?
February 12, 200224 yr quote: Originally posted by signal: If(IsOutsideHitter = "Yes", "OH, ", "") & If(IsMiddleHitter="Yes", "MH, ", "") & If(IsSetter="Yes", "Set, ", "") & If(IsDenfense="Yes", "Def", "") All four fields have to be marked "Yes" for the calculation ot work. I am just trying to create a text string that shows what has been selected. The "&"s are acting like "and if". Try substituting "and" for "&".
February 12, 200224 yr quote: Originally posted by signal: It is possible to select more than one option. Won't case() exit as soon as one option is satisfied? Yes, in which case I'm not sure what result you want. Your original calculation should produce a result like: OH, Set if IsOutsideHitter and IsSetter are both "Yes". If the fields IsOutsideHitter, IsMiddleHitter, IsSetter and IsDefense can each only contain "Yes" or "No", then why not simplify by having one field, say, Type, which draws on a valuelist?
February 12, 200224 yr Author Figured it out (actually my friend did). The "Do not evaluate if all fields are not referenced" was checked. Must be an FM 5.5 "enhancement". I was freaking out.
February 12, 200224 yr Author Yes, but has it worked? My friend said he read about it working differently in 5.5 and that's how he knew right away what the problem might be. I swear that's the first time I ever had to uncheck it. Of course, I have many damaged brain cells.
February 13, 200224 yr A couple of comments. First, the behavior has changed in 5.5 to correct bugs in prior versions. Second, Case statements do NOT exit when "one option is satisfied". A Case Statement evaluates each argument and each result. It then returns the first true one. Same for Choose. HTH Old Advance Man
February 13, 200224 yr Author Could you explain how evaluating every statement then choosing the first true one is different from exiting after the first case it comes to is true? I haven't used the case statement before.
Create an account or sign in to comment