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.

Occurrences of a value in a field

Featured Replies

Hi folks, I'm a newbie here so I hope I'm posting this question in the right place. I'm trying to figure out if there's a way of counting the number of times a value appears in a field ... for example something like

Count(CacheTotal "1 2")

with "1 2" being a value produced by the expression (CacheA & " " B CacheB). I know the above is incorrect but i'm hoping it may illustrate the kind of thing that I'm trying to do. Any help would be GREATLY appreaiated.

Giles

Use PatternCount.

PatternCount(CacheTotal "1 2")

Hi slstrother,

You forgot a ","

SB

PatternCount(CacheTotal, "1 2")

Hi Giles,

There is also a way to use the PatternCount on the fly, by creating a global field using it in place of your pattern of "1 2". You can then look for any pattern in that field including the "1 2".

I could send you a small demo file of this if you need it.

Lee

cool.gif

Thank you Lee, sometimes the fingers don't react to input from the brain, they do what they want.

If I understood giles' question, I believe he's looking for a way to count the number of records in which a particular field contains "1 2".

For that I guess the best way to go would be to perform a find on "1 2" in that field, then the result will be Status(CurrentFoundCount)

Well, now he has a second way to go. I wonder if we will ever know if either one of these is what he wanted.

smile.gif

Well Lee, if he didn't ask for your sample, I'd rather be interrested by this one.

How come you have so many samples. Did you made a sample database or something ?

Thanks anyway for helping us out every time you can.

Well, here is a third way (if Jasonwood's interpretations is right).

Make a global field that is called SearchText

Make a calculation called SeachFound that is If(TheField = SearchText, 1, 0)

Make make a summary field which is set as 'Total of SearchFound'.

Then if you enter 1 2 in the SearchText field, the summary field will update to tell you how many times 1 2 appeared in TheField in the current found set of records. This way, you can search always for different things using then same system.

Here is the file I mentioned.

It's a FMP 5,x and although I made it up on a Mac, I Ziped it. Let me know if you have any problems with getting it opened.

Lee cool.gif

PatternCountGiles.fp5.zip

  • Author

Hi everybody.

WOW! what a response. Thank you all for your help I really appreciate it! Thanks Lee (smith) for taking the time to make a demo of PatternCount

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.