Jump to content

This topic is 8390 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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 ]

Posted

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 ]

Posted

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 "&".

Posted

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?

Posted

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.

Posted

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.

Posted

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

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.