4 Replies Latest reply on Nov 4, 2011 10:01 AM by ijontichy

    Getting totals based on value list items

    ijontichy

      Title

      Getting totals based on value list items

      Post

      Maybe this is easy so I appreciate your patience.

       

      Let's say for the sake of argument that I have a very simple database that keeps two pieces of information

       

      Name   Shirt Size

       

      Shirt size is entered via a pulldown from a value list.

       

      Now, in the past, I've always created a calc field to the tune of:

       

      If Shirt Size = "XL"; 1;0

      and than a summary field that counts that specific calc field.

       

      But if, having set up that database with all the different sizes a new size is added, it's a pain to have to set up yet another calc and summary field.

       

      It strikes me there's a better way and I simply have not learned it.

       

      OR is there a way to automatically "generate" the cal using the values in the Value list?  That way when a new value is added the calculation is done automatically?

       

      I hope I've provided enough information to make sense.  And I remain grateful for any help that can be provided.

       

      e.

       

       

       

        • 1. Re: Getting totals based on value list items
          philmodjunk

          Use a "count of" summary field to count your records. Of course, this counts all your records, not just those of one specific size, but then you can do this:

          Add a sub summary part to your layout "when sorted by" Shirt size.

          Put the summary field inside this sub summary part.

          enter browse mode and sort your records by Shirt Size (sort order must include the same field as what you selected for the sub summary part.)

          The sub summary part now displays a sub total for each shirt size.

          You can keep the body layout part if you want to list each record with it's subtotal or you can remove the layout part and get just the sub totals.

          • 2. Re: Getting totals based on value list items
            ijontichy

            This works and solves my immediate need but it lacks a bit of...informational elegance?

            For example:  If I did remove the Body, the sub summary would give me totals by size but not the size itself.   

            So...how could I indicate in the subsummary part that

            Large=27

            Medium=10

            And is there a way to automatically add the new size to that list when a new size comes into play?

            If not, I'm good, but Filemaker has so many wonderful functions I feel that this one is out there. 

            • 3. Re: Getting totals based on value list items
              philmodjunk

              You would add the size field to the sub summary part as well so that you see the size and the count in the sub summary part.

              Since the size is data entered into the same field each time, it will be automatically included in this report the first time you add a record to the report's found set with this value.

              • 4. Re: Getting totals based on value list items
                ijontichy

                Thank you, PhilModJunk!