4 Replies Latest reply on Jun 22, 2017 7:05 AM by anjani

    Counting values in a filed

    anjani

      I created a field having 3 values - strongly Agree, disagree, Agree. NOw I need to count number of each values in the fields, I created a list summary of the field and did"patter count" calculation  to count each values..

      I did like this

      patterncount(summary field list name;"Agree")

      which should give me no. of "agree" values only. unfortunately it is counting both "agree" and "strongly agree" string.

      How can I differentiate these two strings in my calculation fields?

       

      thanks.

        • 1. Re: Counting values in a filed
          philmodjunk

          It would be better if your "check box field" generated and deleted records in a related table. See the link at the bottom for a way to do that. Such a table makes counting the number of values of each type a lot simpler and more flexible to work with.

           

          But for your current file, you can do this:

           

          Not IsEmpty ( FilterValues ( "agree" ; CheckBoxFieldHere ) )

           

          This will return 1 if agree is selected but not if disagree is selected.

           

          Adventures in FileMaking #2-enhanced value selection

          1 of 1 people found this helpful
          • 2. Re: Counting values in a filed
            keywords

            You can find as follows. in Find Mode:

            1.     Enter "strongly" to find only the first value

            2.     Enter "==agree" to find only the second value (using == finds exact match)

            3.     Enter "disagree" to find only the second value

            Don't use the quotation marks, obviously. They are just used for clarity here.

            • 3. Re: Counting values in a filed
              bigtom

              You have good advice from philmfdjunk and keywords. I would also like to suggest you can use ExecuteSQL function.

               

              ExecuteSQL ("SELECT COUNT( \"your_pk_field\" ) FROM \"your_table\" WHERE \"select_field\" =?"; ""; ""; "Agree")

               

              You can use this in a calc field just the same as a list summary or you can run this calculation on layout enter for data displays in a global field or variable. This is relationship free and you can add additional WHERE terms to isolate various types of data. Want to see the difference in answers between gender, age groups or any other data you have on the survey taker, it is easy.

              1 of 1 people found this helpful
              • 4. Re: Counting values in a filed
                anjani

                Thanks bigtom and @philmodjunk . It worked.

                yeeehhh!!!! (y)