14 Replies Latest reply on May 29, 2009 6:37 PM by annacaltech

    Summary for counting checkboxes

    annacaltech

      Title

      Summary for counting checkboxes

      Post

      Hi,

       

      I am trying to count have been checkboxes are checked in each sorted catagory on my summary page, but it does not sum them up, it just says 1 even if 4 is checked...

       

      Do anyone know what I have missed?

       

      (In summary options I have chosen: Total, Running total, restart summary for each sorted group.)

       

      Thanks,

      Anna

        • 1. Re: Summary for counting checkboxes
          philmodjunk
            

          Check box formatting in filemaker is usually an option that is applied to a text field. Usually, this format is selected when you want a user to be able to select multiple values on your check box list. When you click a check box in a field the first time, the corresponding text from the assigned value list is inserted into the field. Each subsequent check box that is clicked will append value list text to the field separating the text with carriage return characters.

           

          Do you have a field with multiple check boxes or just one checkbox for the field?

           

          If you just need to know how many records have one or more checkbox value selected in a given field, the "count of" type of summary field will count the number of records for you.

           

          If you have, say three checkboxes in each field and want to know the total number of checked boxes over the found set, you'll need to set up a special calculation field and then create a "Total Of" type summary field to count your boxes.

           

          Since multiple values will be separated by a carriage return, the following expression can be used in a calculation field's definition:

           

          If(not Isempty (YourCheckboxField); PatternCount(YourCheckboxField; "¶") + 1; 0 )

           

          Set the calculation to return "number" and clear the "do not evaluate if all the referenced fields are empty" check box. (Put the name of your field in place of "YourCheckboxField".)

           

          Now define your "total of" summary field to give you the total of this calculation field.

          • 2. Re: Summary for counting checkboxes
            raybaudi
              

            PhilModJunk wrote:

             

            If(not Isempty (YourCheckboxField); PatternCount(YourCheckboxField; "¶") + 1; 0 )


            Wasn't simpler:

             

            ValueCount ( YourCheckboxField )

             


            • 3. Re: Summary for counting checkboxes
              philmodjunk
                 This old timer forgot that (new to me) function! Thanks for the simplification.
              • 4. Re: Summary for counting checkboxes
                annacaltech
                  

                It is still not working, some says the sum is 2 when it is no boxes checked and some has a question mark.

                 

                I have now set the summary field to:

                 

                =Count of Checkboxfield (running with restart), when sorted by Sorting field

                 

                What I am missing.  

                 

                Thanks for the help!

                anna 

                • 5. Re: Summary for counting checkboxes
                  philmodjunk
                     Try placing a copy of your field next to your check box formatted field but format it as a plain edit box so that you can see the actual contents. You may have data hidden in the field that does not show because the check box formatting hides it from you.
                  • 6. Re: Summary for counting checkboxes
                    annacaltech
                      

                    It looks like the summary field is counting all checkboxes and not only the ones that are checked...

                     

                    anna 

                    • 7. Re: Summary for counting checkboxes
                      TSGal

                      annacaltech:

                       

                      It's been more than a week now.  Were you finally able to figure this out?  If not, can you give us an example what isn't working?  This may help us better understand what is occurring.

                       

                      TSGal

                      FileMaker, Inc. 

                      • 8. Re: Summary for counting checkboxes
                        annacaltech
                          

                        First of all I want to thank you for following up on this. I have to admit that I had given up on that problem for the moment. 

                         

                        Ok, I will be as thorough as possible: What I want to do is to, on my summary page, sum up the checkboxes that are checked per subgroup. 

                         

                        What it seems to do now is to sum all the checkboxes and not only the checked ones.

                         

                        My summary field options look like this:

                         

                        Count of is chosen, Available Fields: mycheckboxfield, When sorted by: mysortingfield, Running count is checked as well as Restart summary for each sorted group and Summarize repetitions: individually.

                         

                        Thanks for the help!

                         

                        Anna 

                        • 9. Re: Summary for counting checkboxes
                          philmodjunk
                            

                          Did you try my suggestion for placing an unformatted copy of the check box field next to the formatted version? If so, what did you see?

                           

                          You may need to click into the unformatted field to see if there are any invisible carriage returns in that field. (Any such carriage return characters will affect the the results of the ValueCount function Raybaudi recommended.)

                           

                          • 10. Re: Summary for counting checkboxes
                            comment_1
                              

                            annacaltech wrote:

                            What I want to do is to, on my summary page, sum up the checkboxes that are checked per subgroup.


                            I am not sure what that means.

                             


                            annacaltech wrote:
                            My summary field options look like this:

                             

                            Count of is chosen, Available Fields: mycheckboxfield, When sorted by: mysortingfield, Running count is checked as well as Restart summary for each sorted group and Summarize repetitions: individually.


                            What that does is count the records where mycheckboxfield is not empty.

                             



                            • 11. Re: Summary for counting checkboxes
                              philmodjunk
                                

                              Putting several suggestions in this thread together:

                               

                              Define a calculation field:

                               

                              ValueCount(checkboxfield)

                               

                              Let's call it "ValueCountFld".

                               

                              Define a summary field set to compute "Sum Of" ValueCountFld.

                               

                              That will return the count of all checked items in checkboxfield across the entire found set.

                               

                              Does that do what you want?

                              • 12. Re: Summary for counting checkboxes
                                annacaltech
                                  

                                No I have not yet because I do not know what a unformatted copy is...could you explain how I make one of those?

                                 

                                thanks,

                                anna 

                                • 13. Re: Summary for counting checkboxes
                                  philmodjunk
                                    

                                  Enter layout mode, use the field tool to place a new field on your layout and don't use field/control setup... to assign the check box value list to it. Now it's a simple edit box field that will show the true contents of your formatted check box field and you can see how the contents change when you click check boxes.

                                   

                                  After re-reading the entire thread, I'm not sure if the above experiment is necessary. If you are still using a "Count of" summary field instead of what I restated in my previous post, (use a "total of" summary field that sums up the valuecount calculation field), then try that first as it will likely do what you need.

                                  • 14. Re: Summary for counting checkboxes
                                    annacaltech
                                      

                                    Thanks, it works finally!!!

                                     

                                    anna