Results 1 to 4 of 4

Thread: Calculation?

  1. #1
    Join Date
    May 2006
    Posts
    7

    Unanswered: Calculation?

    Say a text field [field1] contains more than one value [from a value list]. I want to set up a conditional (IF) calculation. But instead of looking for an equality or a non-equality, is there a way to have FMP look to see if a field is NOT EQUAL or UNEQUAL to a certain value, but if a field CONTAINS a certain value or text string?

    In other words, let's say field1 contains the values: "CC" & "paragraph" & "BP". I am only interested in whether or not the field contains "CC" irrespective of any other value it may also contain. However, the way I would normally set this up is say: IF field1 = "CC"; but, in this case, I would not get a TRUE response, even though the field CONTAINS "CC", because it is not actually EQUAL to "CC". It is EQUAL to "CC" & "paragraph" & "BP".

    I've had a few false starts and have tried a few things; but nothing yet. I'm thinking I may have to take this value list and divide it into a number of different fields, instead of one field containing anything chosen from the value list. Is this the only way to go?

    Any ideas?

  2. #2
    Join Date
    Aug 2005
    Location
    Minneapolis, MN
    Posts
    56
    Try:

    position(¶ & field & ¶; "¶CC¶"; 1; 1)

    This will return a 0 if the value CC is not in there, and an integer greater than 0 if it is. This can be used in boolean logic without problems:

    case(position(¶ & field & ¶; "¶CC¶"; 1; 1) ; "Value exists")

  3. #3
    Join Date
    May 2006
    Posts
    7
    Quote Originally Posted by <Ender>
    Try:

    position(¶ & field & ¶; "¶CC¶"; 1; 1)

    This will return a 0 if the value CC is not in there, and an integer greater than 0 if it is. This can be used in boolean logic without problems:

    case(position(¶ & field & ¶; "¶CC¶"; 1; 1) ; "Value exists")
    Is this a Text Function? I will check it out. Thanks. Never use these functions much. Not sure I exactly understand how this works; but I should be able to figure it out.

    Thanks again.

  4. #4
    Join Date
    May 2006
    Posts
    7
    Just wanted Ender to know that his/ her suggestion was a good one! Instead of doing exactly what he/ she suggested, I studied the "case" and "position" functions and realized that these were exactly what I needed! I was able to come up with a working solution based on this lead; so thanks again!

    CL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •