If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > FileMaker > Calculation?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-02-06, 19:19
drakedane drakedane is offline
Registered User
 
Join Date: May 2006
Posts: 7
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?
Reply With Quote
  #2 (permalink)  
Old 05-02-06, 20:27
<Ender> <Ender> is offline
Registered User
 
Join Date: Aug 2005
Location: Minneapolis, MN
Posts: 56
Try:

position(&#182; & field & &#182;; "&#182;CC&#182;"; 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(&#182; & field & &#182;; "&#182;CC&#182;"; 1; 1) ; "Value exists")
Reply With Quote
  #3 (permalink)  
Old 05-02-06, 23:04
drakedane drakedane is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 05-12-06, 11:36
drakedane drakedane is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On