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.

Portal Filtering (AND, not OR)

Featured Replies

Let me first see if I can describe a hypothetical in order ask my question:

One file, "foo.fp5", contains records which include, let's say, three text fields: "Name", "Organization", "Hobby" or something like that. In that file, let's define a calc field called "Match":

Match =

Substitute(Name, " ", "

The one line answer is that "AND" requires a multi-key, "OR" requires a compound key. An "OR" search would create a key:

Name & Organization & Hobby

In practical application, I usually delimit parts of the compound key with a "-" and set the indexing to ASCII. An example of why is provided by a Building and Unit scenario:

Key = Bldg & Unit

Bldg 1 Unit 11 = Key 111

Bldg 11 Unit 1 = Key 111 oops!

1-11 and 11-1 are much better (set the indexing on the Key to ASCII or the "-" is ignored!)

-bd

  • Author

Thanks for your reply, though if I read it correctly, I don't believe it addresses what I'm after. I want only one entry field "SearchFor" in which the user can type a term or term(s) which could appear in ANY of the example fields (which themselves could each contain 0,1, or more words), and I don't want the user to worry about entry order (ie: I don't want "Name term must be typed before Organiztion term" in the SearchFor field).

The multi-line key to multi-line key relationship I described in the hypothetical works, functionally and interface-wise, exactly as I want, except that in this case I want exclusive (AND) results rather than inclusive (OR) results.

Thanks.

LiveOak allready gave you the correct answer to your question.

If you need to allow random order entries in seachField you'll need to anticipate every permutation in rightKey field (in example you gave Match field in related file)

Match =

Name & Organization & Hobby

&

"

If you intend to use relationships for your search, it does. The technique is still the same, how the user inputs information and how you create the key (calculations, etc.) is up to you.

"OR" searches use multi-keys, "AND" searches use compound keys.

How you allow the user to enter text in any order and parse it into the primary key needed to match the compound key in the related file is up to you. You might have to look at each word and see which of three lists it occurs in to determine which words in the search to use and in which order to combine them. You will probably need a compound multi-key to allow matches with two or three terms entered. Your compound multi-key for one record might look like:

Name-Any-Any

Any-Organization-Any

Any-Any-Hobby

Name-Organization-Hobby

Name-Organization-Any

Name-Any-Hobby

Any-Organization-Hobby

"Any" could just be a single character to save size. You can now build a primary key to perform "AND" or "OR" searches and combination.

How you allow users to enter keys with abbreviation and spelling errors and still accomplish primary key generation is up to you. Finds are a lot more flexible, but slower.

-bd

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.