A READER ASKS: Counting FileMaker Checkbox Options

From Dwayne Wright PMP
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit. For the best experience, please visit the journal directly by clicking (here). 

A READER ASKS
I was wondering if you could help me figure out how to correctly format a calculation. I have a field with three checkboxes.

Sling results: dry, improved and failed.

How can I be able to calculate how many are dry, how many are improved and how many have failed? Is there also a way to show percentages? % failed?

-------
DWAYNE RESPONDS
There may be a way to do this with a custom function but you would need FileMaker Advanced to do that. Since you only have three options, I’d consider breaking up the count into three different fields using the PatternCount function.

The PatternCount function returns the number of times a string of text occurs. For instance you could setup a calculation that would count the number of times the word dry, improved or failed appear in a field. By default, the PatternCount function is not case sensitive. So I’d suggest three different fields such as ...

CountDry = PatternCount ( Type ; "Dry" )
CountImproved = PatternCount ( Type ; "Improved" )
CountFailed = PatternCount ( Type ; "Failed" )

and this assumes the field you are mentioning might be called “type”. Then you would have a summary field for each such as ...

SumDry = Total Of CountDry
SumImproved = Total Of CountImproved
SumFailed = Total Of CountFailed