giles Posted January 31, 2003 Posted January 31, 2003 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
slstrother Posted January 31, 2003 Posted January 31, 2003 Use PatternCount. PatternCount(CacheTotal "1 2")
Lee Smith Posted January 31, 2003 Posted January 31, 2003 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
slstrother Posted January 31, 2003 Posted January 31, 2003 Thank you Lee, sometimes the fingers don't react to input from the brain, they do what they want.
jasonwood Posted January 31, 2003 Posted January 31, 2003 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)
Lee Smith Posted January 31, 2003 Posted January 31, 2003 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.
Ugo DI LUCA Posted February 1, 2003 Posted February 1, 2003 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.
daltwin Posted February 1, 2003 Posted February 1, 2003 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.
Lee Smith Posted February 1, 2003 Posted February 1, 2003 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
giles Posted February 2, 2003 Author Posted February 2, 2003 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
Recommended Posts
This topic is 7965 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now