Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Logical 'If' Function

Featured Replies

Hopefully, a simple problem for someone.

I wish to apply a wildcard character or equivalent when using an 'If' instruction in a calc for the same field containing similar info, e.g. fields contain 'Door Large' or Door Small' or 'Door Medium' etc. How can I ask FM to identify all fields containing 'Door'?

Thanks in advance.

K

  • Author

Sorry, should have explained a little more.

It is part of a product list and I wish to have another field coded (automatically with a calc) with a product family code, e.g. 'D' for doors, whatever the type of door. This code field reads the full product field and codes itself automatically with a family code, using the If(Product Field = etc. It works OK but I have to tell it each product name in full instead of just picking up the key word.

Hope this is clearer. I am not highly experienced and there could well be a better way of doing it.

Thanks again.

You can use the PatternCount() or Position() functions to find a chunk of text in a bigger chunk of text. You could do something like:

Category = case(

PatternCount(Upper(ProductName)),"DOOR"),"Door",

PatternCount(Upper(ProductName)),"WINDOW"),"Window",

"Other")

You can add as many items to the above calculation as you need. If it doesn't find a match, it will return "other"

Having said this, this may not be the best way to achieve what you are trying to do. Is is possible that some product names may have more than one of the keywords in it? For example, could you have a product called "door with window in it" or some such thing?

quote:

Originally posted by Keith Shelton:

Hopefully, a simple problem for someone.

I wish to apply a wildcard character or equivalent when using an 'If' instruction in a calc for the same field containing similar info, e.g. fields contain 'Door Large' or Door Small' or 'Door Medium' etc. How can I ask FM to identify all fields containing 'Door'?

Thanks in advance.

K

What are you trying to do? Do you want to see a found set of record which contain the word "door" in a given field?

If this is the case, simply do a find and put "door" as the criteria into the appropriate field. It will find all of the records in which "door" is a word in that field.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Consultant

Database Resources

mailto:[email protected]

http://www.database-resources.com

=-=-=-=-=-=-=-=-=-=-=-=-=

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.