signal Posted February 12, 2002 Posted February 12, 2002 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 ]
The Bridge Posted February 12, 2002 Posted February 12, 2002 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 ]
signal Posted February 12, 2002 Author Posted February 12, 2002 It is possible to select more than one option. Won't case() exit as soon as one option is satisfied?
danjacoby Posted February 12, 2002 Posted February 12, 2002 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 "&".
The Bridge Posted February 12, 2002 Posted February 12, 2002 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?
signal Posted February 12, 2002 Author Posted February 12, 2002 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.
Vaughan Posted February 12, 2002 Posted February 12, 2002 No, that's been in FMP for a few versions now.
signal Posted February 12, 2002 Author Posted February 12, 2002 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.
Steven H. Blackwell Posted February 13, 2002 Posted February 13, 2002 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
signal Posted February 13, 2002 Author Posted February 13, 2002 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.
Recommended Posts
This topic is 8390 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now