Jump to content

Counting text?

This topic is 6104 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I've browsed the boards for a while but haven't found anything specifically regarding my problem.

I have a database with multiple text fields which I am now going to have to count regularly. Huge pain to do manually, as there are over 8000 records to sort through.

I need a way to create a set of calculation fields that determine repetitions in a particular field with a specific value out of a value list. i.e.:) let's say that I have one field, "positive blood culture" and it has two possible values "POS" and "NEG", which are defined in a value list. How would I create a calculation field that would count the repetitions of "POS" (but disregard "NEG")and output that as a number?

I guess basically I need a function that calculates the total number of repetitions of a particular text string in a given field.

Link to comment
Share on other sites

You'll need a calculated field for each value,

e.g. a field called POS:

positive blood culture = "POS"

and a field called NEG:

positive blood culture = "NEG"

and then you can count them separately.

Another possibility is to create a Subsummary report, and then use the GetSummary function to extract the totals.

PS: Be careful of the term "repetitions" as that has a specific meaning in FileMaker-land that I don't think is your intent here.

Link to comment
Share on other sites

You're probably right, and thanks for your suggestions.

This database was created before I got here, and is a totally flat database. Do you think it would be better to create a related table for the calculated fields, or would it be simpler to include them in the table with all of the data?

Also, which function would I use, to calculate the number of "POS" values that I have in the "Blood Culture" field?

Sorry to ask so many beginner questions, but FMP has a lot to learn about!

Link to comment
Share on other sites

The value of the field will be POS or NEG, correct? Use the calculations I gave you. They will evaluate to "1" if true. Then you will still need to count them somehow.

The calculated fields should stay in the same table as the blood culture field. Whether they should all go in a different table is another issue (my guess is yes).

Another way to do it is make a script that simply searches for POS and then puts Get(FoundCount) into a field, and do the same for NEG.

Link to comment
Share on other sites

This topic is 6104 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

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