Jump to content
Sign in to follow this  
lonesomejubilee

Summarizing data in one field

Recommended Posts

Hi,

I'm a newbie coming from MS Access so I'm used to writing queries. My question is I don't see how to count the number of occurrences in one field. For example, in one field I have a drop down selection of 16 choices. I want to be able to total how many occurrences of each of the 16 choices happen in one field. (i.e. 5 reds, 4 blues, 10 oranges... all in the field categor "color"). In MS Access I could write a query to do this and it would be easy... in FM I am still getting used to the Find... (which is nice to do certain things)

Thanks... Vandy

Share this post


Link to post
Share on other sites

Try this:

PatternCount ( color ; "red" ), etc. for each class. Then, for the found set, you would want a Summary Field, Total of PatternCount ( color ; "red" ), etc. Hopefully, your colors are distinct!

Share this post


Link to post
Share on other sites

The field would be a calculation using the function PatternCount, as Transpower has described.

Share this post


Link to post
Share on other sites

I'm sorry, I've never seen the PatternCount function before. Do I have to make a patterncount summary field for each category in the field? Then summarize it?

Share this post


Link to post
Share on other sites

Each type will have an associated PatternCount calculation field and summary field, defined as the total of the calculation field.

Share this post


Link to post
Share on other sites

Here's a quickly-assembled sample file for doing this using two repeating fields. Go to the Summary layout to see the results. Note that summary fields only act on the found set, so all records must be found before the totals will be accurate for the table.

CountColors.zip

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

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