January 16, 200224 yr 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
January 16, 200224 yr Try this: Case(PatternCount(cn; "Basketball"); "Basketball" ; PatternCount(cn; "Football"); "Football" ; ... ; "no sports) Gerd [ January 16, 2002: Message edited by: Gerd Muller ]
January 16, 200224 yr Author 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
January 16, 200224 yr 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
January 16, 200224 yr Author 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 ; )
Create an account or sign in to comment