January 31, 200323 yr 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
January 31, 200323 yr 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
January 31, 200323 yr Thank you Lee, sometimes the fingers don't react to input from the brain, they do what they want.
January 31, 200323 yr 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)
January 31, 200323 yr 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.
February 1, 200323 yr 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.
February 1, 200323 yr 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.
February 1, 200323 yr 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 PatternCountGiles.fp5.zip
February 2, 200323 yr 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