Jump to content

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

Recommended Posts

Posted

So I'm trying to make a calculation field that will put records into certain groups if one of the fields contains a certain text. Is there an operator "contains" for text field calculations? For example,

case (position cn "Basketball", "Basketball", position cn "Ice Hockey, "Ice Hockey", "no sport")

Since the text could be at the front or middle of the field, I can't figure out how to make FMP recognize distinct text within a field. Thanks...

Bevin

Posted

Try this:

Case(PatternCount(cn; "Basketball"); "Basketball" ; PatternCount(cn; "Football"); "Football" ; ... ; "no sports)

Gerd

[ January 16, 2002: Message edited by: Gerd Muller ]

Posted

Well, I played with what you gave me and came up with this:

Case(

(PatternCount(Position, "Basketball")=1) and (PatternCount(Position, "M")=1), "Men's Basketball", "no sport")

Thanks for the step in the right direction.

Bevin

Posted

Hi Bevin

You can skip the "=1" because all values greater than 0 are true. So you can write:

Case(

(PatternCount(Position, "Basketball")) and (PatternCount(Position, "M")), "Men's Basketball", "no sport")

nevertheless, you are getting in troubles, if you have sports like "Mountainbike" or "Badminton", where you have an "M" in the name already...

What are typical contents in your field "Position"? Wouldn't it be better to have a valuelist with sports where you can choose from?

Gerd

Posted

I'm taking answers from a survey (which i didn't design and was answered in excel), where the field position could have a number of titles, such as assistant m basketball, 1st assistant m basketball, head m basketball, to refer to the coach of a team. I'm trying to do summary layouts of all basketball coaches, all football coaches, etc. I've done this by running consecutive searches for the words, printing, and then having the script go directly to the next search. This isn't the best way, of course, and I'm trying to add the field "sport" to group all coaches (with different titles) of the same sport together.

Hm.

Bevin

next time, i'll just design the initial survey ; )

This topic is 8453 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.