4 Replies Latest reply on Jul 11, 2013 3:09 PM by MrMunchkin

    How Can I Create A Stacked Bar Chart From A Summary Field and Product Field

    MrMunchkin

      Title

      How Can I Create A Stacked Bar Chart From A Summary Field and Product Field

      Post

           Hi,

           I am trying to create a stacked bar chart from a summary field and a product field to show up in a dashboard layout. 

           I think what I am trying to accomplish is simple, but that I just don't know the correct syntax to be able to filter the chart. 

           Here is what I have:

           Product Field - in here there are two types of product A and B

           Summary Field - is a summary of the total cost of product Field

           Date Field - showing dates

           Month Sort Field - showing months

           I can create a normal bar chart which shows the combined total of A + B in per month. This works perfectly.

           However, I would like to show it on a stacked bar chart where I can see the individual total for A + B.

           Does anyone know how to do this? I would appreciate any help.

           Is it done with a calculation from the chart screen for the X or Y axis? Is it something to do with the way the data is sorted?

            

        • 1. Re: How Can I Create A Stacked Bar Chart From A Summary Field and Product Field
          philmodjunk

               For two products you'll need 4 fields. For more products it's double the number of products you want to chart as you add two more fields for each additional product.

               Field 1 is a calcualtion field that only returns an amount if the product is product A. Field 2 is a summary field that computes the total of that new calculation field. Field 3 is the same as field 1, but specifies a different product and FIeld 4 summarizes field 2 just like FIeld 2 summarizes FIeld 1.

               Then you use Field 2 for the first Y-axis series and Field 4 for the second y-axis series in order to get what you need for your stacked bar chart.

          • 2. Re: How Can I Create A Stacked Bar Chart From A Summary Field and Product Field
            MrMunchkin

                 Hi Phil,

                 Thanks again for the help and quick response.

                 Im still very new to filemaker and don't know anything about calculations and the syntax to use.

                 I understand what you have written, but am having trouble creating the caclulation.

                 Could you write an example calculation.

                 Here is what I had

                 I created a new field and called it "Get Product A"

                 Get Product A = "A"

                 I then created a get summary field "Get Summary Product A"

                 GetSummary ( Tonnage Summary ; Get Product A )

                 I repeated this for product B

                 but when i came to make a chart nothing is happening. It comes up empty.

            • 3. Re: How Can I Create A Stacked Bar Chart From A Summary Field and Product Field
              philmodjunk

                   You need an If Function. (Functions can be easily looked up in FIleMaker Help, There's even a help page that lists all functions by category that you might want to spend an hour or two browsing through to get an idea of what is possible in calculations in FIleMaker.)

                   cProductACost:

                   If ( ProductID = "A" ; CostFIeld )

                   Select Number as the result type. This field will be empty when ProductID is not "A". A summary field can then compute the total fo cProductACost.

              • 4. Re: How Can I Create A Stacked Bar Chart From A Summary Field and Product Field
                MrMunchkin

                     Hi Phil,

                     Thanks for the help, your suggestions and solution worked perfectly. 

                     You have been a massive help. I owe you another virtual beer.

                     Thanks Again